ADSM-L

AW: select query misbehaving?

2005-02-23 07:17:58
Subject: AW: select query misbehaving?
From: Thomas Rupp <Thomas.Rupp AT ILLWERKE DOT AT>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Wed, 23 Feb 2005 13:16:12 +0100
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

<Prev in Thread] Current Thread [Next in Thread>