TekOnline

SQL Cheat Sheet

Find duplicates in table:

SELECT column_name, COUNT(*) as num_duplicates 
FROM table_name 
GROUP BY column_name 
HAVING COUNT(*) > 1;

Delete specific records by id:

DELETE FROM TrappingEvents
WHERE id IN (2241, 2273, 3167, 3181, 3277, 3278, 4876, 1454, 1456, 3236);

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *