Here is something similar that we use on our syste
select * from intbadpfxx a where not exists
(select * from intbadpfxx b where b.atmrec = 'H' and
a.atmseq = b.atmseq and
exists
(select * from intbadpfxx c where c.atmrec = 'S' and
C.atmseq = b.atmseq
and exists
(select * from intbadpfxx d where d.atmrec = 'D' and
c.atmseq = d.atmseq)))
I know it doesnt directly answer your question, but it shows the idea of
what you want
Alan Shore
Programmer/Analyst, Distribution
E:AShore@xxxxxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill
Peter_Vidal@pall.
com
Sent by: To
midrange-l-bounce midrange-l@xxxxxxxxxxxx
s@xxxxxxxxxxxx cc
Subject
04/21/2009 11:54 SQL: Join file 1 and 2, but only if
AM not in 3
Please respond to
Midrange Systems
Technical
Discussion
<midrange-l@midra
nge.com>
Hi list!
This SQL beginner has a question:
SELECT
T02.ITNBR, T02.STID, T02.ITRV, T02.ITDSC,
T02.UNMSR, T02.QCTYP, T02.QCDAY, T02.INTYP, T02.BLCF, T02.ALLOC
FROM WHDTA/SHRITMS T01, AMFLIB1/ITMRVA T02
WHERE T01.ITNBR = T02.ITNBR AND (STID = 'H1P')
ORDER BY T02.ITNBR ASC, T02.ITRV ASC
I am joining these 2 files and listing the results; however, I have a new
requirement and that is to list these fields ONLY if T02.ITNBR is not in
our history file called IMHIST. What will be the SQL statement to provide
these results?
Thanks in advance!
PETER VIDAL
MAPICS IT TECHNICAL SUPPORT TEAM / SR SYSTEM ANALYST
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
Tel:727-849-9999, x2414 /// Fax:727-815-3120
WWW.PALL.COM
"Wisdom outweighs any wealth."
Sophocles (496 BC - 406 BC), Antigone
--------------------------------------------------------------------------------
Attention:
This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.
--------------------------------------------------------------------------------
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.