user2056633
user2056633

Reputation: 151

remove products from mysql if 1 column is empty?

Well this is a bit difficult to ask but I will try my best to ask it in a way that everyone understands it. (well i hope). :)

I have a table in mysql called "products". There is a column in that table called "clicks".

how can i remove/delete a product from the mysql database IF the "clicks" column is Empty or 0 ?

all the products get saved in the mysql database with a unique ID by the way.

any help or code samples would be appreciated so I understad it better.

Thanks

Upvotes: 1

Views: 71

Answers (1)

hank
hank

Reputation: 3768

Simply DELETE FROM table WHERE clicks IS NULL OR clicks = 0;

Upvotes: 3

Related Questions