Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 43C529FB6B5 for ; Thu, 31 May 2007 06:17:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 15769-06 for ; Thu, 31 May 2007 06:17:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from weatherbeeta.com.au (218-214-212-153.people.net.au [218.214.212.153]) by postgresql.org (Postfix) with SMTP id B71F39FB65F for ; Thu, 31 May 2007 06:17:37 -0300 (ADT) Received: (qmail 5613 invoked from network); 31 May 2007 09:17:35 -0000 X-NetworkBox-HamSign: 0101;OUT;wbeetaau1;c075247d749eec8c73b535b7b3a231ae; Received: from mail.weatherbeeta.com.au (10.10.0.2) by network-box.weatherbeeta.com.au with SMTP; 31 May 2007 09:17:35 -0000 Received: (qmail 407 invoked by uid 1166); 31 May 2007 19:17:26 +1000 Received: from 172.20.0.155 by mail.weatherbeeta.com.au (envelope-from , uid 1165) with qmail-scanner-1.25-st-qms (clamdscan: 0.88.6/2315. perlscan: 1.25-st-qms. Clear:RC:1(172.20.0.155):. Processed in 0.399023 secs); 31 May 2007 09:17:26 -0000 X-Antivirus-mail.weatherbeeta.com.au-Mail-From: phillip.smith@weatherbeeta.com.au via mail.weatherbeeta.com.au X-Antivirus-mail.weatherbeeta.com.au: 1.25-st-qms (Clear:RC:1(172.20.0.155):. Processed in 0.399023 secs Process 400) Received: from it-phil.weatherbeeta.com.au (HELO wbaus090) (172.20.0.155) by mail.weatherbeeta.com.au with SMTP; 31 May 2007 19:17:24 +1000 From: "Phillip Smith" To: "'ali nas'" Cc: Subject: Re: ASK about SQL Date: Thu, 31 May 2007 19:17:31 +1000 Organization: Weatherbeeta Pty Ptd Message-ID: <01cd01c7a364$85198dd0$9b0014ac@wbaus090> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 In-Reply-To: <939490.480.qm@web38207.mail.mud.yahoo.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Importance: Normal X-Scanned-By-wbeetaau1: Virus scan performed by network-box X-Scanned-By-wbeetaau1: Scanner file id is wbeetaau1-1180603055.639-5607-000 X-Scanned-By-wbeetaau1: No known viruses found in message (received+scanned in 0.03/0.10 secs) X-Scanned-By-wbeetaau1: Spam-Check-Result: No, hits=0 required=7 tests= autolearn=no version=2.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/209 X-Sequence-Number: 28489 Yes, you can order it the same as how you've listed in the IN condition, = but you need to use the ORDER BY clause... Essentially you just need to pass = the same list to both IN and ORDER BY but with some slightly different formatting...=20 SELECT ean FROM icitem WHERE ean IN (4902715720005, 4909411012151, 4909411010164, = 4902715688718, 4902715731605, 4909411008864, 4909411010188, 4909411010126, = 4909411010140, 4909411012052, 4902715720104, 4909411010089, 4909411010201, 0) ORDER BY CASE WHEN ean =3D 4902715720005 THEN '1' WHEN ean =3D 4909411012151 THEN '2' WHEN ean =3D 4909411010164 THEN '3' WHEN ean =3D 4902715688718 THEN '4' WHEN ean =3D 4902715731605 THEN '5' WHEN ean =3D 4909411008864 THEN '6' WHEN ean =3D 4909411010188 THEN '7' WHEN ean =3D 4909411010126 THEN '8' WHEN ean =3D 4909411010140 THEN '9' WHEN ean =3D 4909411012052 THEN '10' WHEN ean =3D 4902715720104 THEN '11' WHEN ean =3D 4909411010089 THEN '12' WHEN ean =3D 4909411010201 THEN '13' WHEN ean =3D 0 THEN '14' ; -----Original Message----- From: ali nas [mailto:ali_llg21@yahoo.com]=20 Sent: Thursday, 31 May 2007 18:57 To: Phillip Smith Subject: Hal: [SQL] ASK about SQL YES, I don't care with with ORDER BY clause. beacuse i just want what = the data INPUT as like that the data OUTPUT ,so INPUT listed =3D OUTPUT = listed. so there isn't way in POSTGRES to do like this ?? ----- Pesan Asli ---- Dari: Phillip Smith Kepada: ali nas Terkirim: Kamis, 31 Mei, 2007 3:44:12 Topik: RE: [SQL] ASK about SQL You will need to explicitly tell Postgres what order you want it in - = unless you tell PG the order you want with an ORDER BY clause, it assumes you = don't care. I can't recall 100% the exact syntax for the ORDER BY in your case, but someone else more with it than me at the moment will be able to... Hang tight! :) -----Original Message----- From: ali nas [mailto:ali_llg21@yahoo.com]=20 Sent: Thursday, 31 May 2007 18:31 To: Phillip Smith Subject: Hal: [SQL] ASK about SQL THX's for answered my question. YES, i want POSTGRES just do SELECT in the IN condition. add clue, = POSTGRES will show the SELECT data which POSTGRES find first. I dont wanna like = that. So what will I do ?? *******************Confidentiality and Privilege = Notice******************* The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message = or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email. Information in this message that does not relate to the official = business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be = liable for direct, indirect or consequential loss arising from transmission of = this message or any attachments =20 ________________________________________________________=20 Kunjungi halaman depan Yahoo! Indonesia yang baru!=20 http://id.yahoo.com/ *******************Confidentiality and Privilege Notice******************* The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email. Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments