Author |
Message |
Onlymovies
Mudiripoyina Bewarse Username: Onlymovies
Post Number: 24635 Registered: 01-2009 Posted From: 199.173.226.236
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 1:10 pm: |
|
Stewie:
Thanks bhayya.. it worked.. SHER.. BABBAR SHER
|
Onlymovies
Mudiripoyina Bewarse Username: Onlymovies
Post Number: 24634 Registered: 01-2009 Posted From: 199.173.226.236
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 12:59 pm: |
|
Stewie:
let ;me check this query.. SHER.. BABBAR SHER
|
Onlymovies
Mudiripoyina Bewarse Username: Onlymovies
Post Number: 24633 Registered: 01-2009 Posted From: 199.173.226.236
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 12:59 pm: |
|
Gaali:Employee table edi nee SQL lo?
first simple oka table lo data read cheyyataniki try chestunna.. online lo vunna examples mostly single table ki vunnayi.. first single table ki run chesi choosi, next multiple tables ki try cheddam ani.. aa query raasaanu.. danikee error vastundi... SHER.. BABBAR SHER
|
Gaali
Celebrity Bewarse Username: Gaali
Post Number: 27266 Registered: 03-2004 Posted From: 131.247.54.65
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 12:50 pm: |
|
Onlymovies:select CNTCT_INFO_UID, LISTAGG(EMAILADDR, '; ') WITHIN GROUP (ORDER BY EMAILADDR) "emails" from EMAIL
Employee table edi nee SQL lo? |
Stewie
Kurra Bewarse Username: Stewie
Post Number: 1361 Registered: 03-2011 Posted From: 96.57.168.20
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 12:39 pm: |
|
select employeeid , substr(SYS_CONNECT_BY_PATH(employeeid, ','),2) email_list from ( select employeeid, count(*) OVER ( partition by employeeid) cnt, ROW_NUMBER () OVER ( partition by employeeid order by employeeid) seq from email ) where seq=cnt start with seq=1 connect by prior seq+1=seq and prior employeeid= employeeid; idem ostondoo cheppu okasari Patha Signature teeseysa
|
Onlymovies
Mudiripoyina Bewarse Username: Onlymovies
Post Number: 24632 Registered: 01-2009 Posted From: 199.173.226.236
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 12:27 pm: |
|
Ravanabrahma:google lo chodu thammi listagg syntax..evado okadu examples tho ichi untadu.. idi chodu use avuthundemo
Stewie bhayya ichina link lo vunnatte raasa query. still i am getting the same error.. search chesina taruvaate post vesaa.. select CNTCT_INFO_UID, LISTAGG(EMAILADDR, '; ') WITHIN GROUP (ORDER BY EMAILADDR) "emails" from EMAIL this is the quey i wrote.. order by emailaddr daggara error choopistundi.. 'ORA-00923: FROM keyword not found where expected' SHER.. BABBAR SHER
|
Stewie
Kurra Bewarse Username: Stewie
Post Number: 1355 Registered: 03-2011 Posted From: 96.57.168.20
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:53 am: |
|
Ravanabrahma:google lo chodu thammi listagg syntax
anduke nen munde link ichesa.. Patha Signature teeseysa
|
Ravanabrahma
Mudiripoyina Bewarse Username: Ravanabrahma
Post Number: 19384 Registered: 06-2004 Posted From: 99.67.73.204
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:51 am: |
|
Onlymovies:ORA-00923: FROM keyword not found where expected
google lo chodu thammi listagg syntax..evado okadu examples tho ichi untadu.. idi chodu use avuthundemo http://docs.oracle.com/cd/E14072_01/server.112/e10592/functions087.htm |
Onlymovies
Mudiripoyina Bewarse Username: Onlymovies
Post Number: 24630 Registered: 01-2009 Posted From: 199.173.226.236
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:40 am: |
|
Ravanabrahma:
ORA-00923: FROM keyword not found where expected SHER.. BABBAR SHER
|
Ravanabrahma
Mudiripoyina Bewarse Username: Ravanabrahma
Post Number: 19383 Registered: 06-2004 Posted From: 99.67.73.204
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:38 am: |
|
try to use listagg function select listagg(email, ',') within group (order by email) from table1 where ...... |
Ferrari
Kurra Bewarse Username: Ferrari
Post Number: 4919 Registered: 09-2010 Posted From: 75.149.150.97
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:36 am: |
|
Onlymovies:Employee table ------------------------------------------ employeeid - empname ------------------------------------------ 01 - sam 02 - john ------------------------------------------ Email table ------------------------------------------ employeeid - email ------------------------------------------ 01 - sam1@email.com 01 - sam2@email.com 02 - john@email.com ------------------------------------------ I need result as ------------------------------------------ sam - sam1@email.com, sam2@email.com john - john@email.com
yaa ardham ayyindi le annay...Stewie baa oka link ichaadu gaa adi follow ayipoooo BTDB Rocks!!
|
Onlymovies
Mudiripoyina Bewarse Username: Onlymovies
Post Number: 24629 Registered: 01-2009 Posted From: 199.173.226.236
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:34 am: |
|
Employee table ------------------------------------------ employeeid - empname ------------------------------------------ 01 - sam 02 - john ------------------------------------------ Email table ------------------------------------------ employeeid - email ------------------------------------------ 01 - sam1@email.com 01 - sam2@email.com 02 - john@email.com ------------------------------------------ I need result as ------------------------------------------ sam - sam1@email.com, sam2@email.com john - john@email.com SHER.. BABBAR SHER
|
Ferrari
Kurra Bewarse Username: Ferrari
Post Number: 4916 Registered: 09-2010 Posted From: 75.149.150.97
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:30 am: |
|
Onlymovies:email table lo emails same column lo vuntaayi... emp id is FK to employee table., so we cannot do e2.email1, e2.email2... :-(
swarry annay nenu wrong gaa interpret chesaanu nee kochen ni stewie annay ichina link follow ayipoo BTDB Rocks!!
|
Ferrari
Kurra Bewarse Username: Ferrari
Post Number: 4915 Registered: 09-2010 Posted From: 75.149.150.97
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:27 am: |
|
Onlymovies:
konchem table lo data format ela undo example ivvu annay..neeku ye format lo kaavalo kooda cheppu BTDB Rocks!!
|
Stewie
Kurra Bewarse Username: Stewie
Post Number: 1354 Registered: 03-2011 Posted From: 96.57.168.20
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:27 am: |
|
Use the SYS_CONNECT_BY_PATH operator http://www.dba-oracle.com/t_converting_rows_columns.htm Patha Signature teeseysa
|
Onlymovies
Mudiripoyina Bewarse Username: Onlymovies
Post Number: 24627 Registered: 01-2009 Posted From: 199.173.226.236
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:26 am: |
|
Ferrari:
email table lo emails same column lo vuntaayi... emp id is FK to employee table., so we cannot do e2.email1, e2.email2...
SHER.. BABBAR SHER
|
Ferrari
Kurra Bewarse Username: Ferrari
Post Number: 4914 Registered: 09-2010 Posted From: 75.149.150.97
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:24 am: |
|
i think ilaa raayochu anukuntaa select e1.empid||'-'||e2.email1||','||e2.email2 from e1,e2 where e1.empid = e2.empid
BTDB Rocks!!
|
Onlymovies
Mudiripoyina Bewarse Username: Onlymovies
Post Number: 24626 Registered: 01-2009 Posted From: 199.173.226.236
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, March 14, 2012 - 10:19 am: |
|
I have a employee table, and have a email id table. I can have multiple email id's for the same user. Now I want to display all the users with their userid's (in the same column) like shown below emp0 - email01, email02 emp1 - email11 emp2 - can I do this using single SQL query? if not how can I do that.. please suggest... SHER.. BABBAR SHER
|