dbTalk Databases Forums  

Query using group

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Query using group in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Prasath
 
Posts: n/a

Default Query using group - 04-23-2008 , 07:35 AM






i have a table with 4 columns, they look like

currency1 currency2 amt1 amt2
=======================
USD GBP 10 9
GBP USD 5 8
JPY INR 20 7
INR JPY 14 100

i want to cross add the amounts for each group of currency1 and
currency2. now, the currency groups are bit unusal. For example,
the first two rows in the above table fall under the group USD+GBP (or
GBP+USD, the other does not matter)

the result should look like

currency1 currency2 sum1 sum2
USD GBP 18 14 (from 10+8 and 9+5)
INR JPY 120 21 (from 20+100 and 14+7)

any ideas?

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.