pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
(no subject) 2+ messages / 1 participants [nested] [flat]
* (no subject) @ 2001-05-28 11:26 Kapil Tilwani <karan_pg_2@yahoo.com> 0 siblings, 1 reply; 2+ messages in thread From: Kapil Tilwani @ 2001-05-28 11:26 UTC (permalink / raw) To: pgsql-general@postgresql.org; pgsql-sql Hi, I have two tables purchasemaster (Master) and ItemMaster (child) linked through TransactionID I have a query like select * from purchasemaster where transactionid in (select transactionid from itemmaster where itempriority = 2) ****I need this query for MS-Access, MS-SQL and Postgres. Because the application is supposed to be such that for upto 2-3 users, the application would be running on MS-Access or MSDE, while for heavier databases i.e., greater 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 False????). What I am looking at is whether it is possible to execute the query 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 ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [GENERAL] @ 2001-05-30 06:13 Kapil Tilwani <karan_pg_2@yahoo.com> parent: Kapil Tilwani <karan_pg_2@yahoo.com> 0 siblings, 0 replies; 2+ messages in thread From: Kapil Tilwani @ 2001-05-30 06:13 UTC (permalink / raw) To: Randal L. Schwartz <merlyn@stonehenge.com>; pgsql-sql 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 <merlyn@stonehenge.com> To: Kapil Tilwani <karan_pg_2@yahoo.com> 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 > <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/; > 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 ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-05-30 06:13 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2001-05-28 11:26 Kapil Tilwani <karan_pg_2@yahoo.com> 2001-05-30 06:13 ` Re: [GENERAL] Kapil Tilwani <karan_pg_2@yahoo.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox