X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DB74ED1CCAA for ; Sat, 3 Jan 2004 05:21:37 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 03696-09 for ; Sat, 3 Jan 2004 01:20:49 -0400 (AST) Received: from noon.pghoster.com (noon.pghoster.com [64.246.0.64]) by svr1.postgresql.org (Postfix) with ESMTP id 52C68D1B4AE for ; Sat, 3 Jan 2004 01:20:48 -0400 (AST) Received: from [61.5.0.24] (helo=winxp) by noon.pghoster.com with asmtp (Exim 4.24) id 1AceDM-0003QR-I5; Fri, 02 Jan 2004 23:20:45 -0600 Message-ID: <009001c3d1b9$51b2e7a0$1800053d@winxp> From: "Chris Travers" To: "Andy Lewis" , References: <002101c3d197$20082f20$0201a8c0@andy2> Subject: Re: sort by on two columns Date: Sat, 3 Jan 2004 11:05:17 +0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_008A_01C3D1E9.7841CFF0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - noon.pghoster.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - travelamericas.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=4.3 tagged_above=0.0 required=5.0 tests=BAYES_30, HTML_50_60, RCVD_IN_DSBL, RCVD_IN_NJABL, REFERENCES X-Spam-Level: **** X-Archive-Number: 200401/15 X-Sequence-Number: 16408 This is a multi-part message in MIME format. ------=_NextPart_000_008A_01C3D1E9.7841CFF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MessageSELECT * FROM customers ORDER BY last_name, first_name Works for me. ----- Original Message -----=20 From: Andy Lewis=20 To: pgsql-sql@postgresql.org=20 Sent: Saturday, January 03, 2004 8:15 AM Subject: [SQL] sort by on two columns Hi All, Is it possible to sort by two columns? Using the query below? SELECT table1.name, table2.name, FROM table1, ta= ble2 WHERE table1.id =3D table2.id ORDER BY I want to be able to sort the names select from two different tables and = two different colums(same data type). Is this possible? Thanks, Andy ------=_NextPart_000_008A_01C3D1E9.7841CFF0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message
SELECT * FROM customers ORDER BY last_name= ,=20 first_name
Works for me.
----- Original Message -----
Fro= m:=20 Andy Lew= is=20
To: pgsql-sql@postgresql.org
Sent: Saturday, January 03, 2004 8= :15=20 AM
Subject: [SQL] sort by on two=20 columns

Hi=20 All,
Is it p= ossible to=20 sort by two columns? Using the query below?
 
SELECT= =20 table1.name, table2.name, <other selected columns> FROM table1= ,=20 table2 WHERE table1.id =3D table2.id ORDER BY=20 <what?>
 
I want = to be able=20 to sort the names select from two different tables and two different=20 colums(same data type).
 
Is this= =20 possible?
 
Thanks,
 
Andy
------=_NextPart_000_008A_01C3D1E9.7841CFF0--