I would like to know what behavior / differences between a Unique Index and Unique Constraints for MySQL ?
Many should think that this does not make a difference in the database, but it does!
And not only for the DBA / Administrator, but...
Knowing that I have a table called eventos , and this table has the columns id , titulo , inicio and fim . The inicio and fim columns are of type timestamp , where the start and end date and time of...
Reading the question How to zero or null an SQL lookup for a date range for those whose value does not exist? I remembered a similar problem that I have. Usually when I need these sequences that relate to data range I use auxiliary tables to c...
In%%, when fetching all records with a given field with value SQL Server , if I do the following no records are returned:
SELECT *
FROM clientes cli
WHERE cli.cpf = NULL
However, if you use the following syntax:
SELECT *
FROM...
I am making a query to DB, and I want to receive results for the last 7 days from the current date. For this, I have a data field of type DATA (yyyy-mm-dd) in the table. I'm doing the query in php, mysql turn.
$query = mysql_query(SELEC...
I have seen some answers here with Not In and some using Not Exists to answer the same question.
I do not know the difference between both and would like to know about:
Which of the two is best when considering performance?...
I know that as in practically all issues related to "one or the other" there should be situations where it is best to use SET or SELECT , in a procedure (for example).
At work we have the habit of always using SELECT , ev...
I have a non-normalized table in SQL Server installed on my PC which is fed monthly by Integration Services (SSIS) from a report into an Excel worksheet. That is, I am keeping track of a certain report.
This table has several key fields. Depe...
I came across this scenario while modifying a report in the system:
One of querys is returning this table as DUAL :
select * from dual
But in the system there is no DUAL table, and the answer they gave me was that it was a native...