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
 General SQL Server Forums
 New to SQL Server Programming
 Display a blank filed for a certain column value

Author  Topic 

bhavyam
Starting Member

4 Posts

Posted - 2011-07-08 : 00:24:30
i have a table where the data in it is groupbed by the division, i have to display a blank space instead of the value for a certain division for a particular column. eg.

Division col 1 col2 col3
A 5 6 7
B 8 9 10
C 11 12 13
D 14 15 16

So in this table, For division D col 3 the value should be hidden and a blank space should be displayed.

im fairly new to SQL, so any help would be great thanks.

Ranjit.ileni
Posting Yak Master

183 Posts

Posted - 2011-07-08 : 00:41:12
<code>
select
Division
,col1
,col2
,case when Division='D'
then null
else col3
end col3
from <YourTable>
</code>

--Ranjit
Go to Top of Page
   

- Advertisement -