You are here: Re: mysql question : CASE « PHP Programming Language « IT news, forums, messages
Re: mysql question : CASE

Posted by maraguida on 10/09/64 11:36

You might want to try comp.databases.mysql for comprehensive answers.
(X-Post and Followup-To set)

Geradeaus 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

....
WHERE adId in (1, 2)

not tested!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация