Link to home
Start Free TrialLog in
Avatar of pda4me
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?
ASKER CERTIFIED SOLUTION
Avatar of pilson66
pilson66
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
delete from TableA where status not in ('A-Active', 'AC-Active');
DELETE FROM TableA WHERE Status != 'A-Active' OR Status != 'AC-Active'
Avatar of Pratima
delete from TableA where status not in ('A', 'AC');
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial