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)
 Need Help With a SQL Query

Author  Topic 

Krilyn
Starting Member

7 Posts

Posted - 2006-04-10 : 13:49:41
Not sure I can even do this or not so forgive me if I don't explain this correctly. Basically what I'm looking to do is set a column from my selection to a value if certain criteria is matched.

Using psuedo code in between the ()

Select *, (If (Select Distinct(Value) from TableB) = 'T' then Status = 1) as Status from TableA

Any help or direction would be greatly appreciated.

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-04-10 : 13:58:56
I think CASE can be used here.

Give some sample data and results u want to see, if v were to give it a try

Srinika
Go to Top of Page

Krilyn
Starting Member

7 Posts

Posted - 2006-04-10 : 14:22:14
Thank you for pointing me in the right direction with the case. I think I have an idea of how to do it from there. Thanks
Go to Top of Page
   

- Advertisement -