Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Lennart Jonsson Newsgroups: comp.databases.ms-sqlserver Subject: Re: CASE issue Date: Tue, 25 Nov 2014 06:25:12 +0100 Organization: A noiseless patient Spider Lines: 17 Message-ID: References: <547306f8$0$41749$c3e8da3$5d8fb80f@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 25 Nov 2014 05:25:00 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="7e2da11d2f2fa04799963f04fc962890"; logging-data="9211"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hd+ut5QjqvQubZyzM6QUU" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 In-Reply-To: Cancel-Lock: sha1:0D3AatN9pFLvHuOJS5ULNd6Ut/Q= X-TagToolbar-Keys: D20141125062512809 Xref: csiph.com comp.databases.ms-sqlserver:1849 On 11/24/2014 11:37 PM, Erland Sommarskog wrote: > Lennart Jonsson (erik.lennart.jonsson@gmail.com) writes: >> I think (don't have time to look it up now) the SQL-standard says that >> the result of the CASE statement is the first condition that evaluates >> to true. From your answer I get the impression that this is not true for >> SQL-server, correct? > > That is indeed true. The issue is that the expression on the left-hand side > is reevaluated for every branch in the CASE. > I see, thanks /Lennart