Article View: borland.public.interbase.sql
Article #239Re: Help with a "not in" query
From: Bill Todd [TeamB]
Date: Mon, 16 Jun 2008 17:27
Date: Mon, 16 Jun 2008 17:27
18 lines
1684 bytes
1684 bytes
What I was suggesting was: DELETE FROM TABLE 1 WHERE ID_ARTICULO IN (SELECT A.ID_ARTICULO FROM TABLE_1 A LEFT OUTER JOIN TABLE_2 B ON A.ID_ARTICULO = B.ID_ARTICULO WHERE A.ID_VENTA = 20081398 AND A.OBCION = 1 AND B.ID_ARTICULO IS NULL) The select creates a list of all ID_ARTICULOs from TABLE_1 that have the specified ID_VENTA and OBCION values and which do not have a matching row in TABLE_2. It then deletes all of the rows in TABLE_1 whose ID_ARTICULO is in the list returned by the select. I think that is what you want. -- Bill Todd (TeamB)
Technical Details
Message-ID:
<4856a282@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<48558e17$1@newsgroups.borland.com> <4855914f$1@newsgroups.borland.com> <48559360$1@newsgroups.borland.com> <48559a04$1@newsgroups.borland.com> <48569bb2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,82d9b914a86c4cad
X-Google-Attributes: gid114a0e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bill Todd [TeamB]" <no@no.com>
Subject: Re: Help with a "not in" query
Newsgroups: borland.public.interbase.sql
References: <48558e17$1@newsgroups.borland.com> <4855914f$1@newsgroups.borland.com> <48559360$1@newsgroups.borland.com> <48559a04$1@newsgroups.borland.com> <48569bb2$1@newsgroups.borland.com>
Organization: The Database Group, Inc.
User-Agent: XanaNews/1.18.1.9
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 63.147.41.232
Message-ID: <4856a282@newsgroups.borland.com>
Date: 16 Jun 2008 10:27:30 -0700
X-Trace: newsgroups.borland.com 1213637250 63.147.41.232 (16 Jun 2008 10:27:30 -0700)
Lines: 18
X-Authenticated-User: btodd
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail