Hi all, I'm trying to get a result from a simple query. Unfortunatly the result did not come.
Here is the problem:
Say I have a table with 20 records, each of those 4 queries should return 5 records, but only 1 did. 5 records had no value for field1, 5 records had no value for field2, 5 records had no value for field1 and field2 and finally 5 records had value in field1 and field2.
select * from table where field1 = ''
select * from table where field2 = ''
select * from table where field1 = '' and field2 = ''
select * from table where field2 <> ''
The last query return me 5 records. All other queries return 0 row no error ???
Note:field1 and field2 are of type varchar
What did I missI'm clue less
Thanks to anyone that can help!


I'm clue less


when you talk about default value. The following query works

Bookmarks