Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: A SQL Question

RE: A SQL Question

From: DENNIS WILLIAMS <DWILLIAMS_at_LIFETOUCH.COM>
Date: Thu, 13 Mar 2003 06:09:16 -0800
Message-ID: <F001.00568CF7.20030313060916@fatcity.com>


Kirti - I haven't had enough coffee this morning, so it seems to me the obvious solution is an order by clause. What am I missing here?

Dennis Williams
DBA, 40%OCP, 100% DBA
Lifetouch, Inc.
dwilliams_at_lifetouch.com

SQL> select * from test;

C C
- -
A B
C D
E F
G H
B A
F E
D C
H G

8 rows selected.

SQL> select * from test order by col1;

C C
- -
A B
B A
C D
D C
E F
F E
G H
H G

8 rows selected.                  

-----Original Message-----
Sent: Thursday, March 13, 2003 7:24 AM
To: Multiple recipients of list ORACLE-L

Hi SQL Developers,

I have a table as follows:

Col1 Col2


A        B
C        D
E        F
G        H
B        A
E        F
C        D
H        G

With a PK on (Col1, Col2).

How do I write a SQL script to get following result?

Col1 Col2


A        B
B        A
C        D
D        C
E        F
F        E
G       H
H       G

Thanks for your help.

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Deshpande, Kirti
  INET: kirti.deshpande_at_verizon.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: DENNIS WILLIAMS
  INET: DWILLIAMS_at_LIFETOUCH.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). Received on Thu Mar 13 2003 - 08:09:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US