Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subqueries again - rajeevnandanmishra!!!!

Status
Not open for further replies.

ADW

Programmer
Jun 21, 2001
50
GB
Hello, me again, nearly what I'm after although I don't think it's possible to achieve what I want to achieve.

I want to return all rows of 'issu' AND 'recpt' in the same statement, but seperatley! Can't do it can I?
 
Hi adw,

What i understand from your tip is you want something like this


select a.warehouse as 'WAREHOUSE' , a.transaction_type,a.cnt as cntA, b.transaction_type, b.cnt as cntB
FROM (select warehouse, transaction_type, count(*) as cnt from strip group by warehouse, transaction_type) A ,
(select warehouse, transaction_type, count(*) as cnt from strip group by warehouse, transaction_type) B
WHERE a.warehouse=b.warehouse and a.transaction_type>b.transaction_type


Execute this, and please let me know if it works.

 
Hi adw,
Sorry i missed one thing, If you have more than two type of transaction_type then include transaction_type in ('issu','rece') in both inner query's where condition.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top