pda4me
asked on
MySQL Delete records
I have a table called TableA that has a column called 'status' . I need to delete all records where in the table that do not match a status of A-Active or AC-Active.
Can someone give me the proper MySQL command to do this?
Can someone give me the proper MySQL command to do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
delete from TableA where status not in ('A-Active', 'AC-Active');
DELETE FROM TableA WHERE Status != 'A-Active' OR Status != 'AC-Active'
delete from TableA where status not in ('A', 'AC');
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://dev.mysql.com/doc/refman/5.0/en/expressions.html