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 2000 Forums
 SQL Server Development (2000)
 Query to eliminate null values from output

Author  Topic 

vishalj
Starting Member

32 Posts

Posted - 2006-05-22 : 13:00:45
i need to write a query

select a1, a2 from blah blah blah

now a1 might have some null values and i don't want to get the results for those values a2 has no null values though

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-05-22 : 13:08:40
select a1, a2 from blah blah blah
WHERE a1 is not null
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-05-22 : 13:08:46
Do you mean:

select a1, a2 from blah blah blah
WHERE a1 IS NOT NULL

or

select COALESCE(a1, 'No Value') AS a1, a2 from blah blah blah

Kristen
Go to Top of Page

vishalj
Starting Member

32 Posts

Posted - 2006-05-22 : 13:31:24
I already tried these option but since there are lot of joins involved for some reason its not working
i don't know whats going on
anyways thanks for all the replies
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-05-22 : 13:55:29
Post the whole query then, and we can take a look.

Kristen
Go to Top of Page
   

- Advertisement -