Display not null value columns

Posted by Suneel161 under Sql Server on 7/14/2011 | Points: 10 | Views : 3781 | Status : [Member] | Replies : 5
Hi.

i have a table with 5 columns, 3 columns with data available , 2 columns with null values
i want to execute a query with the available data columns, but should not display the null value columns.




Responses

Posted by: A4u_6178 on: 7/14/2011 [Member] Starter | Points: 25

Up
0
Down
Hi suneel,
Specify ur req. clearly , 2 columns with nulls belong to only one table or different tables

Thanks & Regards,

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Suneel161 on: 7/14/2011 [Member] Starter | Points: 25

Up
0
Down
Only one table

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: A4u_6178 on: 7/14/2011 [Member] Starter | Points: 25

Up
0
Down
its simple query,
select colum1, column2,column3 from table name

colum1, column2 and column3 are columns with data
I hope i answered ur question??

Thanks & Regards,

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Umeshdwivedi on: 7/14/2011 [Member] Starter | Points: 25

Up
0
Down
Hallo use this

select * from myTable where myColumn IS NOT NULL

second answer-
SELECT Col1, Col2, .........
FROM Table1
WHERE Col3 IS NOT NULL
AND Col4 IS NOT NULL

Latest Technology Trainer
And Part time software consultant

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Susanthampy on: 7/15/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Select * from TableName where col1 and col2 and col3...and coln not equal to NULL


Regards,
Susan

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response