Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

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?
0
pda4me
Asked:
pda4me
2 Solutions
 
pilson66Commented:
delete from TableA where status != 'A-Active' and status != 'AC-Active';
0
 
pilson66Commented:
0
 
pilson66Commented:
delete from TableA where status not in ('A-Active', 'AC-Active');
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
veeraCommented:
DELETE FROM TableA WHERE Status != 'A-Active' OR Status != 'AC-Active'
0
 
Pratima PharandeCommented:
delete from TableA where status not in ('A', 'AC');
0
 
Cornelia YoderArtistCommented:
BE CAREFUL:

delete from TableA where status != 'A-Active' and status != 'AC-Active';    is CORRECT



DELETE FROM TableA WHERE Status != 'A-Active' OR Status != 'AC-Active'   WILL DELETE EVERYTHING
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now