![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is it possible to concatenate records in a field via Group By clause of an SQL statement? Untested script is : create table t1(country varchar2(32), state varchar2(32), city varchar2 (32)) ; insert into t1 values ('USA', 'CA', 'Sacramento') ; insert into t1 values ('USA', 'CA', 'San Jose') ; insert into t1 values ('USA', 'CA', 'three') ; insert into t1 values ('USA', 'CA', 'four') ; insert into t1 values ('USA', 'CA', 'Fremont') ; insert into t1 values ('Canada', 'OT', 'Ottawa') ; insert into t1 values ('Canada', 'OT', 'Toronto') ; Expected output for the SQL statement would be : USA CA Sacramento, San Jose, three, four, Fremont Canada OT Ottawa, Toronto Thanks in advance. |
#3
| |||
| |||
|
|
Is it possible to concatenate records in a field via Group By clause of an SQL statement? Untested script is : create table t1(country varchar2(32), state varchar2(32), city varchar2 (32)) ; insert into t1 values ('USA', 'CA', 'Sacramento') ; insert into t1 values ('USA', 'CA', 'San Jose') ; insert into t1 values ('USA', 'CA', 'three') ; insert into t1 values ('USA', 'CA', 'four') ; insert into t1 values ('USA', 'CA', 'Fremont') ; insert into t1 values ('Canada', 'OT', 'Ottawa') ; insert into t1 values ('Canada', 'OT', 'Toronto') ; Expected output for the SQL statement would be : USA CA Sacramento, San Jose, three, four, Fremont Canada OT Ottawa, Toronto Thanks in advance. |
![]() |
| Thread Tools | |
| Display Modes | |
| |