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
 How to combine the result set of these 3 queries

Author  Topic 

anchoredwisdom
Starting Member

22 Posts

Posted - 2009-08-27 : 11:09:23
Hi Please help me out.

Brief explanation
select count(*) as C1 from tab1 where x>10
select count(*) as C2 from tab1 where y>20 and Z>40
select prname from prd where pdesc in ('machine','part')


tab1,tab2,prd all these three tables DOESNT have a common column
but they are relate through a fact table called FCT


Output is

prname C1/C2


rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-08-27 : 11:15:12
Hi

Refer this...http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=130328



-------------------------
R...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-08-27 : 11:32:24
whats the column by which they are related?
Go to Top of Page

anchoredwisdom
Starting Member

22 Posts

Posted - 2009-08-27 : 11:50:11
Tab 1 has a column account_id which is present in FCT
table 2 has a column prod_key which is present in FCT
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-08-27 : 11:58:54
and what about prd?
Go to Top of Page
   

- Advertisement -