Jshee
Jshee

Reputation: 2686

Delete Fields Where a Null Value Appeard

blank

So, how do i delete this? I acidentially wrote about 1,500 blank records with prefix null and code = 0

I tried this query and it does nothing:

DELETE FROM Course where prefix IS NULL and code = 0;

The feedback I get is 0 results were deleted.

Anyone?

Upvotes: 0

Views: 1863

Answers (2)

Jason McCreary
Jason McCreary

Reputation: 72971

prefix probably isn't NULL it's an empty string.

Try the following and see if it yields the desired results.

SELECT * FROM Course WHERE prefix = '' AND code = 0;

If so, update your DELETE statement at your own risk ;)

Upvotes: 4

Richard Schneider
Richard Schneider

Reputation: 35477

I bet that prefix is an empty string. Try this:

delete from course where prefix = '' and code = 0

Upvotes: 1

Related Questions