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)
 data from multiple rows

Author  Topic 

jamie
Aged Yak Warrior

542 Posts

Posted - 2007-12-11 : 11:29:28
hi, a quick question ,
I have a table with multiple rows.
id status value
1 1 100
2 2 60
3 5 14

how can I say, where status =1 but show the value where status=5
?
thank you

jamie
Aged Yak Warrior

542 Posts

Posted - 2007-12-11 : 11:32:57
ps, there is also another field id2 which is the same value for the example above
Go to Top of Page

jamie
Aged Yak Warrior

542 Posts

Posted - 2007-12-11 : 11:40:14
think I've worked it out..
INNER JOIN
(select id2 from table where status=1)
WHERE status=5
Go to Top of Page
   

- Advertisement -