Home » SQL & PL/SQL » SQL & PL/SQL » Concatenation query
Concatenation query [message #382752] Sat, 24 January 2009 04:44 Go to next message
Messages: 10
Registered: January 2009
Junior Member
How to concentate the two column values into one.

Create table test
id number(1)
name varchar2(3)

insert into test values (1,'abc');
insert into test values (1,'xyz');

how to get the output in the follwoing way
Excected result:=

1 abcxyz

Re: Concatenation query [message #382758 is a reply to message #382752] Sat, 24 January 2009 06:42 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8727
Registered: November 2002
Location: California, USA
Senior Member
There are a few methods demonstrated in the following thread:


and more examples and methods here:


If you search this forum and the internet, you will find many more.
Re: Concatenation query [message #382766 is a reply to message #382752] Sat, 24 January 2009 08:59 Go to previous messageGo to next message
Michel Cadot
Messages: 65089
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
In addition, please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).
Use SQL*Plus and copy and paste your session.


[Updated on: Sat, 24 January 2009 09:05]

Report message to a moderator

Re: Concatenation query [message #382773 is a reply to message #382752] Sat, 24 January 2009 09:37 Go to previous message
Messages: 540
Registered: February 2008
Senior Member
while using barbara suggested notes, there is a possiblity of getting report value as xyzabc instead of your required abcxyz. Hence you may require one more parameter to control on data behaviour. good luck
Previous Topic: ORA-06502: PL/SQL: numeric or value error
Next Topic: PLS-00049: bad bind variable (merged)
Goto Forum:

Current Time: Thu Jul 27 02:08:10 CDT 2017

Total time taken to generate the page: 0.14511 seconds