I've searched through google and here but didn't find an answer to my question.
I'm trying to use IF in a query (not stored procedure) in that way:
IF EXISTS (SELECT * FROM TABLE WHERE COLUMN=VALUE) THEN
DO SOMETHING
END IF;
I've tryed in MySql Workbench and didn't work (Syntax error).
Anybody knows if it's possible to use IF in that way?
Thanks in advance.
SOMETHINGdo you wish toDO?