dbTalk Databases Forums  

Aggregation, sort of

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


Discuss Aggregation, sort of in the comp.databases.oracle.misc forum.



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

Default Aggregation, sort of - 01-27-2010 , 09:28 AM






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?

Reply With Quote
  #2  
Old   
Michel Cadot
 
Posts: n/a

Default Re: Aggregation, sort of - 01-27-2010 , 10:07 AM






"Sashi" <smalladi (AT) gmail (DOT) com> a écrit dans le message de news: 925076bd-3023-44e5-9747-788f803e05dd...oglegroups.com...
Quote:
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

Reply With Quote
  #3  
Old   
Sashi
 
Posts: n/a

Default Re: Aggregation, sort of - 01-27-2010 , 10:13 AM



On Jan 27, 11:07*am, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
Quote:
"Sashi" <small... (AT) gmail (DOT) com> a écrit dans le message de news: 925076bd-3023-44e5-9747-788f803e0... (AT) a32g2000yqm (DOT) 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

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.