🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #1067

Re: SQL query

#1067
From: Yuri Teirlynck
Date: Tue, 10 Jan 2006 12:01
52 lines
2379 bytes
On 2005-12-26, bd <bertdemuynck@pandora.be> wrote:
[ quote volgorde hersteld ]
> "Bart Vandewoestyne" <MyFirstName.MyLastName@telenet.be> schreef in bericht
> news:1135610739.15413@seven.kulnet.kuleuven.ac.be...
>> Ieps,
>>
>> Mijn broer zou volgende query willen doen in Microsoft Access,
>> maar 't lukt hem precies niet en mijn praktische SQL kennis is nu
>> ook niet supergroot...
>>
>> Twee tabellen:
>>
>> tblFilmGenre met kolommen GenreId en Genre
>> tblHeeftFilm met kolommen FilmId en GenreId
>>
>> Hij wil nu alle genres krijgen die geen films toegewezen hebben.
>> Hoe doen we dat ook alweer?
>>
>> Greetzzz,
>> Bart
>>
> Euhm,
>
> SELECT tblFilmGenre.genre
> FROM tblFilmGenre
> WHERE tblFilmGenre.GenreId NOT IN (SELECT tblHeeftFilm.GenreId FROM
> tblHeeftFilm)
>
> ?
> Bedoel je dit ?
>
> Groetjes,
>
> Bert
>
>

Of

SELECT g.Genre FROM tblFilmGenre g, tblHeeftFilm h
WHERE g.GenreId = h.GenreId
GROUP BY g.Genre
HAVING count(h.FilmId) = 0

Ik denk dat dit iets minder zwaar wordt voor de back-end [hoewel het
voor MS Access niet veel uit zal maken]

Groeten
-- 
Yuri Teirlynck

If it ain't broken yet, it might be foolproof for a while.
Technical Details
Message-ID: <slrnds78lv.c62.yuri@cc.be.tiscali.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail
References: <1135610739.15413@seven.kulnet.kuleuven.ac.be> <XiWrf.81414$zD6.5102705@phobos.telenet-ops.be>

Show Full Headers
Complete Article Headers
X-Google-Thread: fcea4,a795e842cf93de5e
X-Google-Attributes: gidfcea4,public
X-Google-Language: DUTCH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 10 Jan 2006 06:01:50 -0600
Newsgroups: be.comp.programming
From: Yuri Teirlynck <yuri@blubnet.home>
Subject: Re: SQL query
References: <1135610739.15413@seven.kulnet.kuleuven.ac.be> <XiWrf.81414$zD6.5102705@phobos.telenet-ops.be>
Message-ID: <slrnds78lv.c62.yuri@cc.be.tiscali.com>
User-Agent: slrn/0.9.8.1 (Debian)
Date: Tue, 10 Jan 2006 06:01:50 -0600
Lines: 52
NNTP-Posting-Host: 83.134.88.239
X-Trace: sv3-5pwNCU3rgqYc3IsKChOClZylSiwzlB8EOsClrlbpJuunl7ZnE5HzK2dc2NOhBYfKL08Lh7GTl8qNE6K!4njVwhVBseOybejokWwq+2iiHFiorPlyHi0HWq6Zz0Zyow3oKRxolv/3GXZ5pNT2//6LHkRjfRcx!tIU=
X-Complaints-To: abuse@scarlet.be
X-DMCA-Complaints-To: abuse@scarlet.biz
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32