AW: select query misbehaving?
2005-02-23 07:17:58
I'm no SQL guru but ...
!= 'VAULT' is a content comparison and would return records with blanks
or a string of length 0 as well.
IS NULL checks for a datafield that has never been set. You don't check
the content you check a characteristic.
So to be really sure to get all records that are != 'VAULT' you have to
check for both.
select * from volhistory where (type='BACKUPINCR' or
type='BACKUPFULL') and (location!='VAULT' or location IS NULL)
Thomas Rupp
|
|
|