🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #17344

Re: sql vraagje

#17344
From: Ben De Rydt
Date: Wed, 05 Jan 2000 00:00
35 lines
1884 bytes
MindTrap wrote:
> 
> id      1       2       3
> -----------------------------
> 1       eerste  tweede  derde
> 2       pif     poef    paf
> 3       eerste  two     derde
> 
> en ik wil
>         select id from tabel where 1="eerste" and 2="tweede"

> welnu, in plaats van die tabel gebruikt ge de volgende (no matter how
> abnormal):
> 
> id    | type  | value
> ----------------------
> 1       1       eerste                  <-- record 1
> 1       2       tweede
> 1       3       derde
> 2       1       pif                     <-- record 2
> 2       2       poef
> 2       3       paf
> 3       1       eerste                  <-- record 3
> 3       2       two
> 3       3       three

SELECT ID FROM <tabel>
WHERE (type = 1 AND waarde = "eerste") AND
      (type = 2 AND waarde = "two")
GROUP BY ID

maar daar had je zelf toch al kunnen achterkomen.
-- 
ben . de . rydt at pandora . be ------------------ your comments
http://users.pandora.be/bdr/ ------- inl. IPv6, Linux en Pandora
Technical Details
Message-ID: <38739698.5B8A5570@co.and.co>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3873800B.CE8DB5BE@linuxfreak.com> <387382DE.95EA1484@co.and.co> <3873898A.B94BA56E@linuxfreak.com> <38738B1A.FCD7C056@co.and.co> <38738B31.57FF9425@linuxfreak.com> <38738CD3.8878F89C@co.and.co> <387393B9.FC892506@linuxfreak.com>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: fcea4,adf63b3fcd32c9b4
X-Google-Attributes: gidfcea4,public
From: Ben De Rydt <ben@co.and.co>
Subject: Re: sql vraagje
Date: 2000/01/05
Message-ID: <38739698.5B8A5570@co.and.co>
X-Deja-AN: 568750781
Content-Transfer-Encoding: 7bit
References: <3873800B.CE8DB5BE@linuxfreak.com> <387382DE.95EA1484@co.and.co> <3873898A.B94BA56E@linuxfreak.com> <38738B1A.FCD7C056@co.and.co> <38738B31.57FF9425@linuxfreak.com> <38738CD3.8878F89C@co.and.co> <387393B9.FC892506@linuxfreak.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@pandora.be
X-Trace: afrodite.telenet-ops.be 947099115 195.130.154.127 (Wed, 05 Jan 2000 20:05:15 MET)
Organization: soms
MIME-Version: 1.0
NNTP-Posting-Date: Wed, 05 Jan 2000 20:05:15 MET
Newsgroups: be.comp.programming