|
Posted by Geradeaus on 10/09/57 11:36
"Andy Hassall" <andy@andyh.co.uk> schreef in bericht
news:tk2or1dp3lu97bnii8umplektaplm8ovc9@4ax.com...
> On Wed, 4 Jan 2006 17:05:27 +0100, "Geradeaus"
> <gehegeradeaus_nospam_@hotmail.com> wrote:
>
>>I have searched but have not yet found how I can resolve the following
>>problem :
>>
>>SELECT adId,
>> CASE
>> WHEN adId =1 THEN cityId
>> WHEN adId =2 THEN regionId
>> END AS extraField
>>FROM ad
>>WHERE extraField <> 0
>>
>>The problem is "extraField" cannot be used in the WHERE clause... I am
>>using
>>mySQL 4.1
>
> Repeat the CASE in the WHERE clause.
>
> --
> Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
thanks when I repeat it, it works :)
Navigation:
[Reply to this message]
|