Français English Español Italiano Português
User Login    
 + User Registration
Connexion

SQL Case Statement


Author : lotsofcode | Lots of Code
Date : 2008-02-27T14:31:58+01:00
Views : 46

You can use a case statement in SQL like so:


SELECT

id, `name`, title,

CASE id

WHEN 2 THEN 1

WHEN 3 THEN 1

ELSE 0

END AS selectedCase

FROM table



URL : http://community.xoofoo.org/modules/actus_webmaster/view.article.php/10
Trackback : http://community.xoofoo.org/modules/actus_webmaster/trackback.php/10

The comments are owned by the poster. We aren't responsible for their content.
Poster Thread