🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #568

Re: case in calculated field

#568
From: Maxim Shiryaev
Date: Mon, 01 Oct 2007 07:01
30 lines
1627 bytes
Wrog syntax.

It should be

alter table YOUR_TABLE
add TOTAl_ALB integer
computed by
(
case
when (IVA_INC = 1) then 1
when (IVA_INC = 1) and (CON_REQ = 0) then 2
when (IVA_INC = 0) and (CON_REQ = 1) then 3
end
)

Maxim.


"Moore" <delfino03@caramail.com> ???????/???????? ? ???????? ?????????:
news:46ffb40b$1@newsgroups.borland.com...
> is it posible to include case in the sql of a calculated field? is yes
> then why this does not function :
>
> case TOTAl_ALB
> when (IVA_INC = 1) then 1
> when (IVA_INC = 1) and (CON_REQ = 0) then 2
> when (IVA_INC = 0) and (CON_REQ = 1) then 3
>
> TOTAl_ALB is the calculated field
> CON_REQ and IVA_INC are other fields in the same table
Technical Details
Message-ID: <47009a84@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <46ffb40b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,2632d4f685f2ef38
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Maxim Shiryaev" <MaximShiryaev@gmail.com>
Newsgroups: borland.public.interbase.sql
References: <46ffb40b$1@newsgroups.borland.com>
Subject: Re: case in calculated field
Date: Mon, 1 Oct 2007 11:01:55 +0400
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 213.234.197.62
Message-ID: <47009a84@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1191221892 213.234.197.62 (30 Sep 2007 23:58:12 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail