Are you trying to accomplish this in a program, a script or from the command
line?

If you are using a program, what language are you using? If you are using a
script, what platform and shell are you using? (For example, Linux with the
bash shell or Windows.)

If you are using the command line, I'm pretty sure you can't put ifs around
your SQL.

Rhino


----- Original Message ----- 
From: "Luke Venediger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 22, 2004 10:31 AM
Subject: Conditional statement: IF


> Hi,
>
> I'm trying to write a conditional statement in my query. Is the
> following possible in MySQL?
>
> IF(@SomeValue = 1)
> THEN
>  SELECT "The value is 1";
> ELSE
>  SELECT "The value is not 1";
> END IF
>
> I've tried different variations and nothing seems to be working (I'm
> getting syntax errors). I'm using MySQL 4.0.18. Any help would be
> greatly appreciated.
>
> Thanks,
> Luke Venediger.
>
> -- 
> Get Firefox Browser! Reclaim the web. http://getfirefox.com/
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to