Click here to Skip to main content
15,890,717 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
I am using a case Statement in SQL. In my Region field I am getting Null Values from Database. How can i exclude null values and retrieve only data from Region US Canada and Mexico.
I am using following code snippet:


SQL
 case when (pnl.seccodedesc in('NA Debt - East','NA Debt - West','NA Debt - Central','NA Debt - Strategic Cap.') or(pnl.seccodedesc like 'SI -%')) then '1US'
when pnl.seccodedesc='NA Debt - Canada' then '3Canada'
when pnl.seccodedesc='NAL - Mexico' then '4Mexico'end as Region
Posted
Comments
coded007 15-Oct-13 2:44am    
can you post us clearly what you want to do

try following links

SQL ISNULL

ISNULL
 
Share this answer
 
visit here...

SQL
SELECT LastName,FirstName,Address FROM Persons
WHERE Address IS NULL



want to ignore the null values in sql query[^]
 
Share this answer
 
you can this in where condition
SQL
Where ISNULL(pnl.seccodedesc,'') <> '' 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900