From karan_pg_2@yahoo.com Fri Jun 29 07:33:18 2001 Received: from smtp011.mail.yahoo.com (smtp011.mail.yahoo.com [216.136.173.31]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5T7XBa80113 for ; Fri, 29 Jun 2001 03:33:18 -0400 (EDT) (envelope-from karan_pg_2@yahoo.com) Received: from dialpool-210-214-32-101.maa.sify.net (HELO kapil1) (210.214.32.101) by smtp.mail.vip.sc5.yahoo.com with SMTP; 29 Jun 2001 07:33:07 -0000 X-Apparently-From: Message-ID: <001f01c0e812$33a54b60$1300a8c0@kapil1> From: "Kapil Tilwani" To: , Subject: Date: Mon, 28 May 2001 16:56:37 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_011D_01C0E797.28B80380" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Archive-Number: 200106/1203 X-Sequence-Number: 11837 This is a multi-part message in MIME format. ------=_NextPart_000_011D_01C0E797.28B80380 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I have two tables purchasemaster (Master) and ItemMaster (child) linked thr= ough TransactionID I have a query like select * from purchasemaster where transactionid in (select transactionid f= rom itemmaster where itempriority =3D 2) ****I need this query for MS-Access, MS-SQL and Postgres. Because the appl= ication is supposed to be such that for upto 2-3 users, the application wou= ld be running on MS-Access or MSDE, while for heavier databases i.e., great= er than 4 , the ideal database would be Postgres Only the problem is ... (correct me if i am wrong, PLEEEEEEEEEEEASE) that = for each tuple in purchasemaster the sub-query is re-evaluated (True or Fal= se????). What I am looking at is whether it is possible to execute the que= ry in the sub-query just once, get its value as in "(1,2,5,23,7,90)", etc. = in place of the sub-query and accordingly, execute the main query. Thank you, Kapil ------=_NextPart_000_011D_01C0E797.28B80380 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I have two tables purchasemaster= (Master)=20 and ItemMaster (child) linked through TransactionID
 
I have a query like
select * from purchasemaster whe= re=20 transactionid in (select transactionid from itemmaster where itempriority = =3D=20 2)
 
****I need this query for MS-Acc= ess,=20 MS-SQL and Postgres.  Because the application is supposed to be such t= hat=20 for upto 2-3 users, the application would be running on MS-Access or MSDE, = while=20 for heavier databases i.e., greater than 4 , the ideal database would be=20 Postgres
 
Only the problem is ...  (c= orrect me=20 if i am wrong, PLEEEEEEEEEEEASE) that for each tuple in purchasemaster the= =20 sub-query is re-evaluated (True or False????).  What I am looking at i= s=20 whether it is possible to execute the query in the sub-query just once, get= its=20 value as in "(1,2,5,23,7,90)", etc. in place of the sub-query and according= ly,=20 execute the main query.
 
Thank you,
Kapil
------=_NextPart_000_011D_01C0E797.28B80380-- _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com From karan_pg_2@yahoo.com Sat Jun 30 06:13:24 2001 Received: from smtp010.mail.yahoo.com (smtp010.mail.yahoo.com [216.136.173.30]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5U6DOa24876 for ; Sat, 30 Jun 2001 02:13:24 -0400 (EDT) (envelope-from karan_pg_2@yahoo.com) Received: from dialpool-210-214-41-151.maa.sify.net (HELO kapil1) (210.214.41.151) by smtp.mail.vip.sc5.yahoo.com with SMTP; 30 Jun 2001 06:13:22 -0000 X-Apparently-From: Message-ID: <000901c0e8d0$396c14c0$1300a8c0@kapil1> From: "Kapil Tilwani" To: "Randal L. Schwartz" , References: <001f01c0e812$33a54b60$1300a8c0@kapil1> Subject: Re: [GENERAL] Date: Wed, 30 May 2001 11:43:19 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Archive-Number: 200106/475 X-Sequence-Number: 3778 A real (equi) join is not possible because the query what I posted on the mailing list was WRONG... sheesh... sorry what i meant was : select * from purchasemaster where transactionid NOT in (select transactionid from itemmaster where itempriority = 2) Thanx, ----- Original Message ----- From: Randal L. Schwartz To: Kapil Tilwani Sent: Friday, June 29, 2001 7:04 PM Subject: Re: [GENERAL] > why not just do a real join? > > select a, b, c, from from purchasemaster, itemmaster > where purchasemaster.transactionid = itemmaster.transactionid > and itemmaster.itempriority = 2 > > don't fight SQL. :) > > -- > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 > > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. > See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! > _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com