I wanted to skip blank data in MySQL.
My sample query is:
SELECT id, name, date from sample where name IS NOT NULL;
Sample table:
id name date
1 24-04-2012
2 abc 23-04-2012
Now if I fire above query, it gives me both record but I want to skip data which is stored as blank i.e. There is nothing(not even NULL)?
So how can I skip 1st record? What should be my query?
So how to skip blank data in MySQL?
Please guide me.
You can eliminate both
NULLand empty/blank strings from your results using the following:Demo: http://www.sqlfiddle.com/#!2/1155a/6
Edit: As pointed out in the comments,
trimis not even necessary.