I have two tables and should I return the table total with more data, I'm doing this:
SELECT CASE WHEN ((select count(*) as 'familiar' from tb.familiar)) >
((select count(*) as 'personal' from tb.personal))...
I have a Products table with:
ProCodigo - Primary Key de Produto
ProNome
And another Price History table with:
HisCodigo - Primary Key de Histórico
HisData
HisPreco
ProCodigo - Foreign Key de Produto
I need to mount a SELECT that bring...
DBMS: MySQL
Problem: How do I return the subtract of the current date with a specific date and return the value in YEARS, MONTHS and DAYS in a query?
Example:
DADOS
DataAdmissao dataAtual
2010-04-07 2014-06-27 (este dado não está...
I have tried unsuccessfully to get a result.
I have the table with the following Login and Logout information:
|Group |User |EventDate |Event |Camp
------------------------
|Evolution |1012 |2014-07-07 10...
I need to select the data stored in the database and separate them by month, but when the month does not have data yet, the month is not returned.
I need the month to be returned with the value zero but to bring the month anyway.
My Query...
Assuming the following query where we are selecting values, grouping them and then re-grouping the result:
SELECT
CONCAT (b.label, '|', b.slug)
FROM (
SELECT
group_concat(name SEPARATOR '$') AS label,
group_concat(slug...
DBMS: SQL Server 2014;
Problem: I need to know which records are duplicated, so that the verification is done in two simultaneous fields, ie if the field "CPF" with the value '83971465842' and the field 'MAT' with the value ' 001 'exists, in...
I've never seen this command before and I also do not find it around here, I do not know if it has a different name and because of the Oracle documentation, I can not understand exactly how it works. I just want an explanation and a simple examp...