dimanche 31 mai 2015

MySQL IF IS NULL ERROR

I want to test if a select-statement is null but I'am already failing with the case analysis:

SET @dublicate = NULL;
IF @dublicate IS NULL THEN
    SELECT * FROM mysql.user;
END IF;

This should ever return the selection but I just get the following error:

#1064 - You have an error ... near 'IF @dublicate IS NULL THEN SELECT * FROM mysql.user; END IF' at line 2

and i really dont know whats wrong.

Many thanks in advance

KillerMelone

Aucun commentaire:

Enregistrer un commentaire