🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #17347

Re: sql vraagje

#17347
From: MindTrap
Date: Wed, 05 Jan 2000 00:00
55 lines
2454 bytes
Ben De Rydt wrote:
> 
> 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

toegepast op het 1ste record met id 3: 

type=1 -> ok
waarde=eerste -> ok                  ====> AND -> niet ok
type=2 -> niet ok
waarde=two -> niet ok

met andere woorden: dit matcht nooit


of vergis ik me?


> 
> 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

-- 
---
Early bird gets the worm, but the second mouse gets the cheese.
Technical Details
Message-ID: <3873A908.8D2AB38A@linuxfreak.com>
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> <38739698.5B8A5570@co.and.co>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: fcea4,adf63b3fcd32c9b4
X-Google-Attributes: gidfcea4,public
From: MindTrap <IDONTLIKESPAM.MindTrap@linuxfreak.com>
Subject: Re: sql vraagje
Date: 2000/01/05
Message-ID: <3873A908.8D2AB38A@linuxfreak.com>
X-Deja-AN: 568783356
Cache-Post-Path: marvin!unknown@tvd-10-67-52-33.tvd.kotnet.kuleuven.ac.be
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> <38739698.5B8A5570@co.and.co>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@belnet.be
X-Trace: naxos.belnet.be 947104009 2190 134.58.127.3 (5 Jan 2000 20:26:49 GMT)
Organization: KULeuvenNet
X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/)
Mime-Version: 1.0
NNTP-Posting-Date: 5 Jan 2000 20:26:49 GMT
Newsgroups: be.comp.programming