thestoneoflapiz
thestoneoflapiz

Reputation: 55

Selecting NULL values of the particular date

You can get the particular data if date exist in a table row, what "IF" it's "NULL"? Can you get all NULL data of today? Is it possible using mysql query?

Edited:

I have a question, can you retrieve data that are not recorded for a certain date? For example:

  1. Janice Student 2017-xx-xx
  2. Paul Student 2017-xx-xx
  3. Mika Student ------

You can retrive those records with date, but can you retrive data that have no values? Is it possible using mysql query? or conditional x looping statement using PHP?

Upvotes: 0

Views: 90

Answers (1)

Paul Maxwell
Paul Maxwell

Reputation: 35563

To locate information where there is no value stored use IS NULL e.g.

select * from yourtable where column_name IS NULL

If the column is a string of some type then it might be an "empty string", which looks like no value but isn't NULL, so for this use:

select * from yourtable where column_name = ''

or in combination:

select * from yourtable where ( column_name IS NULL OR column_name = '' )

Upvotes: 1

Related Questions