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.
| Author |
Topic |
|
davers
Starting Member
14 Posts |
Posted - 2008-05-27 : 08:49:14
|
| Hi everyone. Is it possible to combine data from 2 queries into 1 query? I have a database that houses a departments info. The query returns: DEPT_NUM, DEPT_GROUPI have another database that houses their statistics and num. The query returns: DEPT_NUM, DEPT_STATSI'd like a query that combines the 2 and gives me: DEPT_NUM, DEPT_GROUP, DEPT_STATS.Is something like that possible?Thanks for any help!DaveWindows XP, Office XP |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-05-27 : 08:54:31
|
| [code]Select q1.DEPT_NUM, q1.DEPT_GROUP, q2.DEPT_STATSFrom(... First Query) q1 join (... Second query) q2on q1.DEPT_NUM = q2.DEPT_NUM[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
davers
Starting Member
14 Posts |
Posted - 2008-05-27 : 14:28:25
|
| Thanks! That's exactly what I had in mind!DaveWindows XP, Office XP |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-05-27 : 14:30:02
|
| You need to study JOINS in Books Online. |
 |
|
|
|
|
|