I’m stuck as I need only one on one records to be returned by my query.
My query:
SELECT emp_code
FROM Test_app_emp_assign_to_store_
WHERE `store_code` IN('AUGT0052', 'AUMT0289', 'AUGT0011', 'AUMT0270', 'AUGT0039', 'AUGT0176', 'AUGT3008', 'AUMT0333', 'AUGT0382')
GROUP BY store_code, emp_code
HAVING count(store_code) = '1';
Only one on one relation data required
2
Answers
use sample :
sample :
Create Table:
Insert Data :
You can do it using
GROUP BY
HAVING count(1)
twice:Demo here