Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL Query
Err, not quite, actually.
The solution presented below will simply generate the cartesian product of the sum of attributes from the table.
The (grossly pedantic) solution is:
select distinct a.col1, a.col2, a.col3||b.col3||c.col3
from fred a, fred b, fred c
where a.col3 = 'A'
and b.col3 = 'B'
and c.col3='C'
... which really begs the question - 'what IS the question?' ! Although this solution works, it would be quite impractical to apply it to 'test' if there were 'n' values of col3.
Imran - try framing your question in general terms.
peter
edinburgh
-----Original Message-----
Sent: Friday, September 19, 2003 5:30 PM
To: Multiple recipients of list ORACLE-L
Assume your table is name fred:
select a.col1 a.col2 a.col3||b.col3||c.col3 from fred a, fred b, fred c;
Allan
-----Original Message-----
Sent: Friday, September 19, 2003 10:15 AM
To: Multiple recipients of list ORACLE-L
Hi,
I have the following data in a table:
col1 col2 col3
1 2 A 1 2 B 1 2 C
I want to display this as :
col1 col2 col3
1 2 A B C
How can i do this?
Regards
Imran
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Imran Ashraf
INET: imran9a_at_hotmail.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Nelson, Allan
INET: anelson_at_midf.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
BGS. . http://www.bgs.ac.uk *********************************************************************
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Robson, Peter
INET: pgro_at_bgs.ac.uk
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Mon Sep 22 2003 - 03:54:34 CDT