querying tables and (result of 2sqlstts joined by query) [message #19370] |
Wed, 13 March 2002 06:15 |
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 |
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!!!
|
|
|