SQLTeam.com | Weblogs | Forums

Work with null


#1

Hello,

I am trying to eliminate NULL value for Type A but keep value of NULL of Type B. How do I query that? Anyone?

SELECT TYPE, CON_#
FROM CONFIC_TBL

HERE IS THE CURRENT RESULT:

TYPE CON_#
A 224
A NULL
B NULL
A 557
B 896

Result I am looking for:
TYPE CON_#
A 224
B NULL
A 557
B 896

Thanks all


#2

Try this:

SELECT TYPE, CON_#
FROM CONFIC_TBL
WHERE TYPE <> 'A' OR CON_# IS NOT NULL

#3

Thanks Scott. It works!