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 2005 Forums
 Transact-SQL (2005)
 Col

Author  Topic 

Mattie1231
Starting Member

3 Posts

Posted - 2008-07-29 : 12:32:49
I am not sure how to explain this
Lets say we have a table with 4 col

Name Flag1 Flag2 Flag3 Flag4
Tim Yes No Yes No



What i need is the Name and the other Col which has Yes in them
So basically the result should look like this

Name Flag1 Flag3
Tim Yes Yes


Could someone help me out
Thank you,

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-29 : 12:37:38
But what happens with multiple rows when you've got one row that has 3 Yes values, second row has 4 yes values, and the third row has 0 yes values?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Mattie1231
Starting Member

3 Posts

Posted - 2008-07-29 : 12:41:00
It is parameter driven so lets say i am passing in "Tim"
i will be bringing just 1 row
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-29 : 12:46:31
quote:
Originally posted by Mattie1231

It is parameter driven so lets say i am passing in "Tim"
i will be bringing just 1 row


why do you want vary the number of columns of result set. can i ask need for such a requirement?
Go to Top of Page

Mattie1231
Starting Member

3 Posts

Posted - 2008-07-29 : 14:40:11
its a report where the client can monitor what process have been executed sucessfully
Go to Top of Page
   

- Advertisement -