| Author |
Message |
   
Dreamcatcher
Side Hero Username: Dreamcatcher
Post Number: 2608 Registered: 11-2009 Posted From: 208.86.145.68
Rating: N/A Votes: 0 (Vote!) | | Posted on Thursday, February 23, 2012 - 12:30 pm: |
    |
Uppu:this works when you have group , I do not have that
Are you not grouping by the FROMCUR? |
   
Sachin
Megastar Username: Sachin
Post Number: 27584 Registered: 04-2008 Posted From: 209.249.19.126
Rating: N/A Votes: 0 (Vote!) | | Posted on Thursday, February 23, 2012 - 12:28 pm: |
    |
Uppu:this bring three separate rows, I want them in one row
separate rows endi adhyakshaaa.... USA ki okate row vasthadi...with 4 columns share ki gross ki thedaa theliyakapothenemi..daatar maaya box office disco lo iragadeesthaaadu... ki ki ki ... |
   
Uppu
Side Hero Username: Uppu
Post Number: 4540 Registered: 11-2007 Posted From: 206.16.32.136
Rating: N/A Votes: 0 (Vote!) | | Posted on Thursday, February 23, 2012 - 12:26 pm: |
    |
Database version 10g, pivot is not working “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |
   
Uppu
Side Hero Username: Uppu
Post Number: 4538 Registered: 11-2007 Posted From: 76.103.128.193
Rating: N/A Votes: 0 (Vote!) | | Posted on Thursday, February 23, 2012 - 01:47 am: |
    |
Dreamcatcher:If you are on 11g, you can use LISTAGG function.
this works when you have group , I do not have that “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |
   
Uppu
Side Hero Username: Uppu
Post Number: 4537 Registered: 11-2007 Posted From: 76.103.128.193
Rating: N/A Votes: 0 (Vote!) | | Posted on Thursday, February 23, 2012 - 01:45 am: |
    |
Sachin:SELECT fromcur, MAX( CASE WHEN TOCUR = 'JPY' THEN rate END) japan_rate, MAX( CASE WHEN TOCUR = 'CHN' THEN rate END) china_rate, MAX( CASE WHEN TOCUR = 'GBP' THEN rate END) gbp_rate FROM rates where fromcur = 'USD' and TOCUR in ('JPY','CHN', 'GBP') GRUOP BY fromcur
this bring three separate rows, I want them in one row “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |
   
Dreamcatcher
Side Hero Username: Dreamcatcher
Post Number: 2605 Registered: 11-2009 Posted From: 96.255.49.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 09:12 pm: |
    |
Like the example shown here... http://www.oracle-developer.net/display.php?id=515 |
   
Dreamcatcher
Side Hero Username: Dreamcatcher
Post Number: 2604 Registered: 11-2009 Posted From: 96.255.49.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 09:11 pm: |
    |
If you are on 11g, you can use LISTAGG function. |
   
Sachin
Megastar Username: Sachin
Post Number: 27568 Registered: 04-2008 Posted From: 68.44.58.32
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 08:28 pm: |
    |
nee enks uppu...etayipoyyyaaav share ki gross ki thedaa theliyakapothenemi..daatar maaya box office disco lo iragadeesthaaadu... ki ki ki ... |
   
Sachin
Megastar Username: Sachin
Post Number: 27567 Registered: 04-2008 Posted From: 68.44.58.32
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:45 pm: |
    |
SELECT fromcur, MAX( CASE WHEN TOCUR = 'JPY' THEN rate END) japan_rate, MAX( CASE WHEN TOCUR = 'CHN' THEN rate END) china_rate, MAX( CASE WHEN TOCUR = 'GBP' THEN rate END) gbp_rate FROM rates where fromcur = 'USD' and TOCUR in ('JPY','CHN', 'GBP') GRUOP BY fromcur share ki gross ki thedaa theliyakapothenemi..daatar maaya box office disco lo iragadeesthaaadu... ki ki ki ... |
   
Sachin
Megastar Username: Sachin
Post Number: 27566 Registered: 04-2008 Posted From: 68.44.58.32
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:44 pm: |
    |
Uppu:fromcur = 'USD' and TOCUR in ('JPY','CHN', 'GBP')
SELECT fromcur, MAX( CASE WHEN TOCUR = 'JPY' THEN rate END) japan_rate MAX( CASE WHEN TOCUR = 'CHN' THEN rate END) china_rate MAX( CASE WHEN TOCUR = 'GBP' THEN rate END) gbp_rate FROM rates where fromcur = 'USD' and TOCUR in ('JPY','CHN', 'GBP') GRUOP BY fromcur share ki gross ki thedaa theliyakapothenemi..daatar maaya box office disco lo iragadeesthaaadu... ki ki ki ... |
   
Entikaburlu
Side Hero Username: Entikaburlu
Post Number: 6996 Registered: 07-2011 Posted From: 67.247.83.224
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:42 pm: |
    |
Uppu:select * from rates where fromcur = 'USD' and TOCUR in ('JPY','CHN', 'GBP')
try this: select fromcur, wm_concat(RATE) from RATES where TOCUR in (..) and fromcur='USD' group by fromcur All Class Notes -> https://twitter.com/#!/EKSWAcademy all opinions expressed are mine and only mine. not to be attributed to the other IP address sharers, my employer, or any other human, animal, robot or alien. |
   
Cyberabadsinnodu
Side Hero Username: Cyberabadsinnodu
Post Number: 2416 Registered: 02-2010 Posted From: 67.163.149.59
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:35 pm: |
    |
use pivot ఎంత చికాగో యునివర్సిటీ లో చదువుకున్నా చిలక్కొట్టుడికి సరైన ఇంగ్లీషు పదం దొరుకుతుందా..!! |
   
Ustad
Side Hero Username: Ustad
Post Number: 8417 Registered: 07-2008 Posted From: 65.161.188.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:29 pm: |
    |
Uppu:
http://www.dba-oracle.com/t_sql_output_one_line.htm Fan of Fab 5: Sachin, Rahul, Saurav, Laxman and Kumble.
|
   
Maverick
Legend Username: Maverick
Post Number: 35399 Registered: 01-2008 Posted From: 192.146.101.24
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:27 pm: |
    |
if u r ok with non sql methids, dump table to a file and use awk to transpose Who is this DB member? |
   
Maverick
Legend Username: Maverick
Post Number: 35397 Registered: 01-2008 Posted From: 192.146.101.24
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:24 pm: |
    |
chala methods untai..check this by burleson htata http://www.dba-oracle.com/t_converting_rows_columns.htm Who is this DB member? |
   
Gandhiguevara
Megastar Username: Gandhiguevara
Post Number: 25533 Registered: 10-2009 Posted From: 66.151.13.188
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:23 pm: |
    |
Uppu:
Tom gaadni adigava? http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUES TION_ID:766825833740 |
   
Uppu
Side Hero Username: Uppu
Post Number: 4536 Registered: 11-2007 Posted From: 206.16.32.136
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:21 pm: |
    |
Maverick:pivot
I think it works with group by “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |
   
Uppu
Side Hero Username: Uppu
Post Number: 4535 Registered: 11-2007 Posted From: 206.16.32.136
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:20 pm: |
    |
Sachin:bhayyaaa...sample data and final output pettu.... nuvvu chepppe daannibatti pivoting cheyyali ani ardham ayindi naaaku
select * from rates where fromcur = 'USD' and TOCUR in ('JPY','CHN', 'GBP') Result FROMCUR TOCUR RATE USD JPY .23 USD chN .12 USD gbp 1.2 But i want them all three in one row. .23 .12 1.2 “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |
   
Maverick
Legend Username: Maverick
Post Number: 35396 Registered: 01-2008 Posted From: 192.146.101.24
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:20 pm: |
    |
pivot operator edo undi ga..did u try? Who is this DB member? |
   
Entikaburlu
Side Hero Username: Entikaburlu
Post Number: 6989 Registered: 07-2011 Posted From: 67.247.83.224
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:20 pm: |
    |
post the table ddl easier to help All Class Notes -> https://twitter.com/#!/EKSWAcademy all opinions expressed are mine and only mine. not to be attributed to the other IP address sharers, my employer, or any other human, animal, robot or alien. |
   
Sachin
Megastar Username: Sachin
Post Number: 27565 Registered: 04-2008 Posted From: 68.44.58.32
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:14 pm: |
    |
Uppu:
bhayyaaa...sample data and final output pettu.... nuvvu chepppe daannibatti pivoting cheyyali ani ardham ayindi naaaku share ki gross ki thedaa theliyakapothenemi..daatar maaya box office disco lo iragadeesthaaadu... ki ki ki ... |
   
Kuyyo_morro
Side Hero Username: Kuyyo_morro
Post Number: 6352 Registered: 02-2011 Posted From: 63.76.147.112
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:13 pm: |
    |
http://msdn.microsoft.com/en-us/library/ms177410.aspx |
   
Uppu
Side Hero Username: Uppu
Post Number: 4534 Registered: 11-2007 Posted From: 206.16.32.136
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:11 pm: |
    |
from country fixed, to country changes “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |
   
Uppu
Side Hero Username: Uppu
Post Number: 4533 Registered: 11-2007 Posted From: 206.16.32.136
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:10 pm: |
    |
Maverick:USD INR .45 CAN USD .56 JPY USD 1
I want .45 .56 1 row to column “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |
   
Uppu
Side Hero Username: Uppu
Post Number: 4532 Registered: 11-2007 Posted From: 206.16.32.136
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:09 pm: |
    |
Cyberabadsinnodu:
no country table, I know the from and two currency I want. regular query brings them as 3 rows. but I want them in single coloumn “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |
   
Maverick
Legend Username: Maverick
Post Number: 35395 Registered: 01-2008 Posted From: 192.146.101.24
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:08 pm: |
    |
Uppu:i need 3 different coutry rates in one query
FROM TO XCHRATE USD INR .45 CAN USD .56 JPY USD 1 ippudu em kavali? Who is this DB member? |
   
Uppu
Side Hero Username: Uppu
Post Number: 4531 Registered: 11-2007 Posted From: 206.16.32.136
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:06 pm: |
    |
Sachin:question ardham kaaale
Currency rate table lo data from cur to cur rate untayi, i need 3 different coutry rates in one query “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |
   
Cyberabadsinnodu
Side Hero Username: Cyberabadsinnodu
Post Number: 2414 Registered: 02-2010 Posted From: 67.163.149.59
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 07:03 pm: |
    |
SELECT countries.name , currency_countries.country_code , currencies.name , currency_countries.currency_code , currencies.current_rate FROM currency_country INNER JOIN currencys ON currency_country.currency_code = currencys.code INNER JOIN countries ON currency_country.country_code = countries.code ఎంత చికాగో యునివర్సిటీ లో చదువుకున్నా చిలక్కొట్టుడికి సరైన ఇంగ్లీషు పదం దొరుకుతుందా..!! |
   
Ustad
Side Hero Username: Ustad
Post Number: 8415 Registered: 07-2008 Posted From: 76.173.42.79
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 06:52 pm: |
    |
Uppu:three countries Currency rates single query extract cheyyali. other than using same table thrice in query emanna options unnaya
Can you describe the table/tables in question and also sample output you are looking for? Fan of Fab 5: Sachin, Rahul, Saurav, Laxman and Kumble.
|
   
Uppu
Side Hero Username: Uppu
Post Number: 4530 Registered: 11-2007 Posted From: 206.16.32.136
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 06:50 pm: |
    |
Entikaburlu:
I think pivot work with group by only “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |
   
Sachin
Megastar Username: Sachin
Post Number: 27560 Registered: 04-2008 Posted From: 68.44.58.32
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 06:48 pm: |
    |
question ardham kaaale share ki gross ki thedaa theliyakapothenemi..daatar maaya box office disco lo iragadeesthaaadu... ki ki ki ... |
   
Kuyyo_morro
Side Hero Username: Kuyyo_morro
Post Number: 6349 Registered: 02-2011 Posted From: 63.76.147.112
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 06:47 pm: |
    |
Uppu:need to multiply USD-JPY with usD-gbp in same query
Subquery raayali. |
   
Uppu
Side Hero Username: Uppu
Post Number: 4529 Registered: 11-2007 Posted From: 206.16.32.136
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 06:45 pm: |
    |
Entikaburlu:pivoting?? hint: wm_concat
konchem detail ga cheppandi, need to multiply USD-JPY with usD-gbp in same query “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |
   
Entikaburlu
Side Hero Username: Entikaburlu
Post Number: 6984 Registered: 07-2011 Posted From: 67.247.83.224
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 06:26 pm: |
    |
pivoting?? hint: wm_concat All Class Notes -> https://twitter.com/#!/EKSWAcademy all opinions expressed are mine and only mine. not to be attributed to the other IP address sharers, my employer, or any other human, animal, robot or alien. |
   
Uppu
Side Hero Username: Uppu
Post Number: 4526 Registered: 11-2007 Posted From: 206.16.32.136
Rating: N/A Votes: 0 (Vote!) | | Posted on Wednesday, February 22, 2012 - 06:22 pm: |
    |
three countries Currency rates single query extract cheyyali. other than using same table thrice in query emanna options unnaya “Generations to come will scarce believe that such a one as this walked the earth in flesh and blood.” |