Home » SQL & PL/SQL » SQL & PL/SQL » querying tables and (result of 2sqlstts joined by query)
querying tables and (result of 2sqlstts joined by query) [message #19370] Wed, 13 March 2002 06:15 Go to next message
citrav
Messages: 7
Registered: October 2001
Junior Member
Thanks for ur earlier help.
Another query that i want is

based on the below given result and another table want to retieve records for certain condition

select person_id
, sum(amount) from
(select person_id, sales_amount amount from Sales
union all
select person_id, purchase_amount amount from purchases)
group by person_id

i WANT THE PERSON_ID FROM THE ABOVE RESULT AND ANOTHER TABLE 'X' WHERE
X.PERSON_ID= ABOVEQUERY.PERSON_ID AND
<CONDITIONS>
ur help is appreciated very much
Similar Question..but char!! [message #19447 is a reply to message #19370] Mon, 18 March 2002 15:02 Go to previous message
chandra
Messages: 31
Registered: October 2000
Member
I would like to obtain the result on one row eg.
PersonId, SalesMgrName, PurMgrName grouping by Person id. I know this can be done using group functions but I need characters(name) here!!

Select person_id...from
(select person_id, SalesMgrName Name from Sales
union all
select person_id, PurMgrName Name from purchases)
group by person_id)

Any help would be appreciated!!!
Previous Topic: RENAME TABLE
Next Topic: Why can't I display a CLOB value on my web site?
Goto Forum:
  


Current Time: Fri Apr 26 13:38:02 CDT 2024