🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.os
Article #3

SQL: 'if' bij een query (redelijk **dringend**)

#3
From: Bram Dispa
Date: Mon, 14 Aug 2000 00:00
19 lines
1508 bytes
Ik heb hier een database in MySQL die ik aanstuur via PHP4.

Ik voeg 2 records samen met een 'GROUP'.
Ik tel de twee velden 'bruto' op.

Dit lukt... Maar wat wil ik nu dat er gebeurt?

Ik voeg 2 records samen met een 'GROUP'.
Als 'status = U', tel ik de tweede 'bruto' bij de eerste op.
Als 'status = I', trek is de tweede 'bruto' van de eerste af.

Hoe formuleer ik deze 'IF'? In MS Access is dit 'IIF', maar in MySQL
blijkbaar niet. Hoe doe ik dit dan in MySQL?

Een CC naar m'n mailbox zou ik leuk vinden als je reply't.
Alvast bedankt!

Bram
bdispa@bigfoot.com -- http://brammeke.net -- ICQ 5960864
Technical Details
Message-ID: <MpTl5.73$3Z6.3114@nreader1.kpnqwest.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: fcea4,59e42f14d937dfc4,start
X-Google-Attributes: gidfcea4,public
X-Google-Thread: 100a19,59e42f14d937dfc4,start
X-Google-Attributes: gid100a19,public
X-Google-Thread: fb9d5,59e42f14d937dfc4,start
X-Google-Attributes: gidfb9d5,public
From: "Bram Dispa" <bdispa@bigfoot.com>
Subject: SQL: 'if' bij een query   (redelijk **dringend**)
Date: 2000/08/14
Message-ID: <MpTl5.73$3Z6.3114@nreader1.kpnqwest.net>
X-Deja-AN: 658138533
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-Complaints-To: abuse@Belgium.EU.net
X-Trace: nreader1.kpnqwest.net 966263532 193.121.44.233 (Mon, 14 Aug 2000 16:32:12 MET DST)
Organization: KPNQwest customer news service
X-MSMail-Priority: Normal
NNTP-Posting-Date: Mon, 14 Aug 2000 16:32:12 MET DST
Newsgroups: be.comp.os,be.comp.os.linux,be.comp.programming