Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 62777B5DBE1 for ; Sat, 17 Sep 2011 10:56:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 76067-02 for ; Sat, 17 Sep 2011 13:56:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from nm5.bullet.mail.ac4.yahoo.com (nm5.bullet.mail.ac4.yahoo.com [98.139.52.202]) by mail.postgresql.org (Postfix) with SMTP id C7109B5DC03 for ; Sat, 17 Sep 2011 10:56:41 -0300 (ADT) Received: from [98.139.52.190] by nm5.bullet.mail.ac4.yahoo.com with NNFMP; 17 Sep 2011 13:56:41 -0000 Received: from [98.139.52.162] by tm3.bullet.mail.ac4.yahoo.com with NNFMP; 17 Sep 2011 13:56:41 -0000 Received: from [127.0.0.1] by omp1045.mail.ac4.yahoo.com with NNFMP; 17 Sep 2011 13:56:41 -0000 X-Yahoo-Newman-Id: 376967.54320.bm@omp1045.mail.ac4.yahoo.com Received: (qmail 71612 invoked from network); 17 Sep 2011 13:56:41 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:References:Mime-Version:In-Reply-To:X-Apple-Yahoo-Original-Message-Folder:Content-Type:Content-Transfer-Encoding:Message-Id:Cc:X-Mailer:From:X-Apple-Yahoo-Replied-Msgid:Subject:Date:To; b=u9SPiCinoBCaoE9sVsMw0mDATFzEMvkT1Vxvi8rwifsJz91r9tHXxKH8Qn5XmWnt9SGqw+UJ5yPgDarLYwsZ4w2qzcLrg000iqrvBhSUfUvcUj/w3K9MeY7mwSGCKaGIBNQziIjmP0E/ZAPwtVmVhTE7QJBm3YTF8TlWmqoGGd8= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1316267801; bh=ZMT2+yr48oAqPioxQdAf2ePkCkJBJgRCprLTJ58U6tE=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:References:Mime-Version:In-Reply-To:X-Apple-Yahoo-Original-Message-Folder:Content-Type:Content-Transfer-Encoding:Message-Id:Cc:X-Mailer:From:X-Apple-Yahoo-Replied-Msgid:Subject:Date:To; b=13qDIy08mf5w6kzay+dojwkFepUAKufFhbGza360OtUqvTVihkS3GT6G2higT/NOThe1HVwhEp5kNjg3YUlnPNCdJyyo5+7e12n01qH+OjEvV6MsXDnIuYf5JY/d3kIowRcqFjO8iApZeDMAvYKgXQOtQkYuaQhsImhC94zbKQY= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: XH3pPf0VM1mtWOYLNaaIE4SbTYMc1Syb6qjsMZBQL6fff2g r22Tx0gDcpZ34H6Glnc0zxv6xAk6UChhhXG6NyZ0ZhiNiVgmWWlQneDL8Cl2 Y40uShcIW3L4iLOpGuU2s9HySWvP0PqEnkM1OAFZz4ARHPiml5EQB3kQ6PBI ElFgxvQZj0UiE7Ewi9dBbHuUDquaj1It2htpN9QUT2FkJfypvCNNQV2mhNZd tooY8mpEVEj_z2Gyjz0VHYToEIFtCSNOJG1f_rsDgZJWKrN2l.WcC.eXGuvB VkNVBHMyHVw8N2fTmsPhAbKDq1DNO4JBpK0x.xVuejmsEchYbiY1JxojeepO atNiSU4K05ys.HhldhPtQRfKho9VNqYsWGGK2p_ziLpxmzpYMioZqlDhTZVE 2H36JDQ-- X-Yahoo-SMTP: mpGJl6eswBD2IBufoVEg0Pa8gg-- Received: from [192.12.17.102] (polobo@24.93.23.188 with xymcookie) by smtp101-mob.biz.mail.ac4.yahoo.com with SMTP; 17 Sep 2011 06:56:41 -0700 PDT References: Mime-Version: 1.0 (iPad Mail 8J2) In-Reply-To: X-Apple-Yahoo-Original-Message-Folder: Inbox Content-Type: multipart/alternative; boundary=Apple-Mail-3-805674614 Content-Transfer-Encoding: 7bit Message-Id: <27CF61B6-2101-4FD7-91BD-DC82C59E9015@yahoo.com> Cc: "pgsql-sql@postgresql.org" X-Mailer: iPad Mail (8J2) From: David Johnston X-Apple-Yahoo-Replied-Msgid: 1_434806_APGkiGIAAF2RTnShhQ5YEC9P7WM Subject: Re: Sorting of data from two tables Date: Sat, 17 Sep 2011 09:56:46 -0400 To: "R. Smith" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.402 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/40 X-Sequence-Number: 35840 --Apple-Mail-3-805674614 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Sep 17, 2011, at 9:32, "R. Smith" wrote: >=20 > What I want to do is do a query joining table A with B and sorting > firstly on a field in Table A then on several fields in Table B. >=20 >=20 > SELECT a.gdn_gdn, a.gdn_custref, a.gdn_date, a.gdn_address_name, > a.gdn_method, b.gdn_stockref, b.gdn_row, b.gdn_bay, b.gdn_shelf > FROM a > LEFT JOIN b > ON a.gdn_gdn =3D b.gdn_gdn > ORDER BY a.gdn_method,b.gdn_row, b.gdn_bay, b.gdn_shelf >=20 It would help if you gave an example comparing the above query results with y= our desired results. It would also help if you actually provided a detailed= description of you goal instead of the generic one quoted above. Given you= r stated need the query does exactly what you requested. David J.= --Apple-Mail-3-805674614 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On Sep 17, 2011, at 9:32, "R. Smith" &l= t;ship.quotes@gmail.com> wro= te:


What I want to do is do a query joining t= able A with B and sorting
firstly on a field in Table A then= on several fields in Table B.


SELECT a= .gdn_gdn, a.gdn_custref, a.gdn_date, a.gdn_address_name,
a.g= dn_method, b.gdn_stockref, b.gdn_row, b.gdn_bay, b.gdn_shelf
FROM a
LEFT JOIN b
ON a.gdn_gdn =3D b.gdn_g= dn
ORDER BY a.gdn_method,b.gdn_row, b.gdn_bay, b.gdn_shelf


It would help if you gave an example comparing the above q= uery results with your desired results.  It would also help if you actu= ally provided a detailed description of you goal instead of the generic one q= uoted above.  Given your stated need the query does exactly what you re= quested.

David J.
= --Apple-Mail-3-805674614--