Friday, October 10, 2014

MySQL Sintax To Find Unmatched Records Between Two Table


Find difference record between two tables. Here the code:
SELECT username
FROM (
SELECT username FROM member_option
UNION ALL
SELECT username FROM member WHERE status='1'
) tbl
GROUP BY username
HAVING count(*) = 1
ORDER BY username;
Good Luck !!!

MySQL Sintax to Find Duplicate Entries


Here the code:
SELECT column FROM table_name group by column having count(*) >= 2
Good Luck !!!