Questions tagged as 'sql'

2
answers

Warning: mysqli_fetch_assoc () expects parameter 1 to be mysqli_result, boolean given in [duplicate]

I have a simple problem when picking up a data from a table .. The error is    Warning: mysqli_fetch_assoc () expects parameter 1 to be mysqli_result,   boolean given in Code: $sql = mysqli_query($conexao, "SELECT diasvip FROM logi...
asked by 07.03.2015 / 14:48
2
answers

Discover from which table the data is in a union

Hello, I have a php system, using codeigniter, and it runs the following command: $data['dados_tabelas'] = Tabela1::find_by_sql('SELECT * FROM tabela1) UNION (Select * from tabela2)'); More or less. I wanted to know if I have to find out wha...
asked by 18.06.2015 / 20:52
2
answers

MySQL Query - Count of crosstable records

I have the following tables: EachtupleofthePageViewstable(main)containsasingle-pageview.Ifasinglepersoninthesamesession(Sessions)viewsthesamepage(Pages),anewtupleisnotaddedinPageViews>.InsteadthePageViews.quantityfieldisincremented.Inonerepo...
asked by 06.12.2017 / 11:21
2
answers

Data Modeling: Integrity vs. Performance

In the company I work for, there is a data architecture I've never seen before, and I wonder if this is common, or if it's a new market trend. Just to mention the bank is Oracle. Here are some points: There is almost no relationship between...
asked by 03.05.2018 / 16:36
4
answers

Query using like operator

In a query in the database I enter the keywords, month, and year. I want to get the data according to the key words, the month and the year. For example: the word school on the date 2015-08 . For this, I use the like instead of =...
asked by 14.08.2015 / 16:11
1
answer

LEFT JOIN using Linq

I have the following tables: Responsavel | Filho Id Nome | Id Nome ResponsavelId 1 Ana | 1 Aninha 1 2 Maria | 2 Ana Júlia 1 3...
asked by 04.08.2015 / 18:52
2
answers

SQL SERVER Data counting of a record

I came across the following situation: The table below is a checklist and has a column of covenants, the others are questions answered with yes (1), no (0) and noFill (null or 9). I wanted to tell in each agreement how many of the questions...
asked by 20.09.2018 / 15:49
1
answer

How to create trigger for all tables in a database, automatically?

Example scenario I have a database with 1000 tables . A table named log . Objective I would like to create a default trigger on each of these tables, automatically . This trigger , whenever there is any change (inser...
asked by 05.09.2018 / 12:36
1
answer

Custom auto increment

I have to generate an auto increment of type "000"+id , but I can not get to something concrete, my base is this below, I just wanted a light how to do it, I do not need the answer itself. > @Id @GeneratedValue...
asked by 15.10.2014 / 19:09
2
answers

How do I transpose a search result using SQL Server?

Or rather telling you how to make the columns of the result of a SQL Server search result become the result lines, as follows in the images below: A search result using the select clause: Maketheresultlooklikethis: Note: Remember...
asked by 04.02.2016 / 16:46