From: Sashi on 27 Jan 2010 10:28 Hi all, (How I wish there was a comp.lang.sql for generic sql questions!). I have a table structured thus: Emp_org, emp_dept, emp_sub_dept, emp_language, emp_location. (This is not my table but an attempt at a simplified example). So there could be 20 employees with the same emp_org, emp_dept and emp_sub_dept. But these 20 guys could be speaking different languages located at different locations. Is there a way to structure a query so that I can group the similar columns together and concatenate the others? So I would end up with emp_org, emp_dept, emp_sub_dept, (emp_language || emp_languange..), (emp_location || emp_location..) Hope this is clear enough. TIA, Sashi for all the employees who share the common first three fields?
From: Michel Cadot on 27 Jan 2010 11:07 "Sashi" <smalladi(a)gmail.com> a �crit dans le message de news: 925076bd-3023-44e5-9747-788f803e05dd(a)a32g2000yqm.googlegroups.com... | Hi all, | (How I wish there was a comp.lang.sql for generic sql questions!). | | I have a table structured thus: | Emp_org, emp_dept, emp_sub_dept, emp_language, emp_location. | | (This is not my table but an attempt at a simplified example). | | So there could be 20 employees with the same emp_org, emp_dept and | emp_sub_dept. | But these 20 guys could be speaking different languages located at | different locations. | | Is there a way to structure a query so that I can group the similar | columns together and concatenate the others? | So I would end up with | emp_org, emp_dept, emp_sub_dept, (emp_language || emp_languange..), | (emp_location || emp_location..) | | Hope this is clear enough. | | TIA, | Sashi | for all the employees who share the common first three fields? Depending on the version: T. Kyte's STRAGG function WM_CONCAT LISTAGG Regards Michel
From: Sashi on 27 Jan 2010 11:13 On Jan 27, 11:07 am, "Michel Cadot" <micadot{at}altern{dot}org> wrote: > "Sashi" <small...(a)gmail.com> a écrit dans le message de news: 925076bd-3023-44e5-9747-788f803e0...(a)a32g2000yqm.googlegroups.com... > | Hi all, > | (How I wish there was a comp.lang.sql for generic sql questions!). > | > | I have a table structured thus: > | Emp_org, emp_dept, emp_sub_dept, emp_language, emp_location. > | > | (This is not my table but an attempt at a simplified example). > | > | So there could be 20 employees with the same emp_org, emp_dept and > | emp_sub_dept. > | But these 20 guys could be speaking different languages located at > | different locations. > | > | Is there a way to structure a query so that I can group the similar > | columns together and concatenate the others? > | So I would end up with > | emp_org, emp_dept, emp_sub_dept, (emp_language || emp_languange..), > | (emp_location || emp_location..) > | > | Hope this is clear enough. > | > | TIA, > | Sashi > | for all the employees who share the common first three fields? > > Depending on the version: > > T. Kyte's STRAGG function > WM_CONCAT > LISTAGG > > Regards > Michel Thank you. I will check them out. Regards, Sashi
|
Pages: 1 Prev: Last not null value from previous rows Next: Query optimization |