Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to query not NULL value?

Author  Topic 

knockyo
Yak Posting Veteran

83 Posts

Posted - 2007-07-26 : 22:34:18
Here is SQL code, but is still can query out the NULL values:

SELECT distinct p.ParameterName
FROM NXP_MAS_DEVICETESTER dt INNER JOIN NXP_PARAMETER_COLSEQ p
ON dt.GroupUniqueId = p.GroupUniqueId
WHERE dt.DeviceUniqueId = 1 AND
dt.TestStation = 'acu' AND
dt.TesterUniqueId = 4 AND
p.ParameterName IS NOT NULL Order BY p.ParameterName

Result:

No| ParameterName
1 |
2 | Value1
3 | Value2
4 | Value3

How to query it that just ignore to NULL values?

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-27 : 01:12:17
is it returning NULL or empty string ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-27 : 04:27:00
AND
NULLIF(p.ParameterName, '') IS NOT NULL



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -