Querying with an empty field.
-
I have a database set up where some columns might have no data entered like in the following example
record [Column1Data : Column2Data] record [Column1Data : Column2Data : Column3Data]
I would like to differenciate between the two records by querying the first record that has no data for column3. I figured on trying SELECT * FROM TABLE1 WHERE Column1 LIKE 'Column1Data' AND Column2 LIKE 'Column2Data' AND Column3 LIKE ('') but this returned no records. Is something like this possible or might this be an issue of database setup? :confused: Thanks! -
I have a database set up where some columns might have no data entered like in the following example
record [Column1Data : Column2Data] record [Column1Data : Column2Data : Column3Data]
I would like to differenciate between the two records by querying the first record that has no data for column3. I figured on trying SELECT * FROM TABLE1 WHERE Column1 LIKE 'Column1Data' AND Column2 LIKE 'Column2Data' AND Column3 LIKE ('') but this returned no records. Is something like this possible or might this be an issue of database setup? :confused: Thanks!Nevermind! Found the solution I believe. for those with curiousity... Is Null for empty fields Is Not Null for not empty fields So for example SELECT * FROM TABLE WHERE COLUMN1 LIKE 'DATA1' AND COLUMN2 Is Null This will return all records where column1 is DATA1 and column2 is blank. "Why are we hiding from the police, Daddy?" "We use VI, son. They use Emacs."