Have a question on request ..
There is one table with fields:
- pare
- day
- aud (maybe a bunch of duplicates)
There is a request:
SELECT auditories.* FROM (SELECT * FROM TRANS_min GROUP BY aud) auditories RIGHT JOIN (SELECT * FROM TRANS_min WHERE pare = 1 AND day = 6 GROUP BY aud) paramAuditories ON paramAuditories.aud = auditories.aud WHERE paramAuditories.aud IS NOT NULL GROUP BY auditories.aud SAMPLE
two times we make a request to the table and make a sample for the first time without a condition; we get a list of all unique records by aud; we make the same selection a second time and impose a condition on the selection by day and pair number - we get a list of unique records by aud
TASK : get the records from the first table which are not in the second table
There are about 2 million entries in the table :-)
SELECT * FROM TRANS_min GROUP BY aud HAVING sum( case when pare = 1 AND day = 6 then 1 else 0 end)=0- Mike