Freedom-n-Democrazy Posted September 12, 2011 Share Posted September 12, 2011 I have this table: +------+---------------+------------+ | id | primarycolour | pricerange | +------+---------------+------------+ | 1 | black | 1 | | NULL | brown | 2 | +------+---------------+------------+ I want to delete the entire entry for NULL. I tried this, but it didn't work: delete from testdb.products where id='NULL'; How can it be done? Also, I don't think saying "deleting an entire entry of data" is correct. Is what I am asking to do is to delete a primary key? Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted September 12, 2011 Share Posted September 12, 2011 close, but by using ='NULL' you are saying "where the field contains a thext string 'NULL' what you need is delete from testdb.products where id IS NULL; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.