Home » SQL & PL/SQL » SQL & PL/SQL » CONCAT (oracle 10g)
CONCAT [message #592250] Tue, 06 August 2013 01:56 Go to next message
satheesh_ss
Messages: 61
Registered: July 2012
Member
select * from table;

Date | Indicator | Name
---------------|----------------|
01/01/2004| 1 | Mr Smith
01/01/2004| 2 | Mr Brown
02/01/2004| 1 | Mr Jones
02/01/2004| 2 | Mr White
02/01/2004| 3 | Mr Black

SELECT date, GROUP_CONCAT(Name) as namelist 
FROM table 
GROUP BY date;

Date | namelist
--------------- |--------------|--------------|
01/01/2004 | Mr Smith, Mr Brown |
02/01/2004 | Mr Jones, Mr White, Mr Black|



In Mysql, they joined the names of the employee in a single column using date.
Likewise, i want query in oracle to do the same.

help me if anyone knows....
Re: CONCAT [message #592251 is a reply to message #592250] Tue, 06 August 2013 02:05 Go to previous messageGo to next message
michael_bialik
Messages: 621
Registered: July 2006
Senior Member
Google for LISTAGG

HTH
Re: CONCAT [message #592253 is a reply to message #592250] Tue, 06 August 2013 02:18 Go to previous messageGo to next message
flyboy
Messages: 1903
Registered: November 2006
Senior Member
Unfortunately, LISTAGG is not present in any 10g Oracle version.

Anyway, many ways of string aggregation are described in this article: http://www.oracle-base.com/articles/misc/string-aggregation-techniques.php
Pick any one you like supported in your Oracle version with one exception: do not use WM_CONCAT. Never.
Re: CONCAT [message #592254 is a reply to message #592250] Tue, 06 August 2013 02:28 Go to previous message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your previous topic:

Michel Cadot wrote on Fri, 21 June 2013 10:25
from your previous topic:

Michel Cadot wrote on Tue, 28 August 2012 20:49
1/ Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.
...


Michel Cadot wrote on Tue, 21 August 2012 09:59
From your previous topic:

Michel Cadot wrote on Thu, 19 July 2012 08:30
Michel Cadot wrote on Tue, 17 July 2012 15:04
Michel Cadot wrote on Tue, 17 July 2012 11:43
Michel Cadot wrote on Tue, 17 July 2012 11:36
From your previous topic:

Michel Cadot wrote on Tue, 17 July 2012 11:35
From your previous topic:

Michel Cadot wrote on Sat, 14 July 2012 16:11
None.

From your previous topics:

Michel Cadot wrote on Thu, 12 July 2012 19:52
...
You not only have to read the Concepts manual but also the Database SQL Reference.

Regards
Michel


Michel Cadot wrote on Thu, 12 July 2012 15:11
From your previous topic:

Michel Cadot wrote on Thu, 12 July 2012 14:08
Please feedback to your previous topics and thanks people that (try to) help you.

Also from your previous topics:

Michel Cadot wrote on Thu, 12 July 2012 08:39
All your questions are answered in Database Concepts.
Please read it.

Regards
Michel


Michel Cadot wrote on Thu, 12 July 2012 08:47
...
Database Concepts

Regards
Michel






Regards
Michel


In addition, this is a FAQ already posted a hundred time, so SEARCH before posting (accordingly to the guide).

Regards
Michel



What is your problem in writing this?
With any SQL question, Post a working Test case: create table and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Use SQL*Plus and copy and paste what you already tried.

Regards
Michel


...



Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.


Michel Cadot wrote on Thu, 19 July 2012 10:43
PL/SQL User's Guide and Reference
Application Developer's Guide - Fundamentals
...


As you are unable to read and comply simple rules, I'm sure you are anyway unable to read and understand any PL/SQL.


With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

And find a less stupid title to your topic.

Regards
Michel



Previous Topic: Need help in writing code [merged 2 by jd]
Next Topic: CASE STATEMENT
Goto Forum:
  


Current Time: Thu Apr 25 19:46:08 CDT 2024