I have a simple table called unzip
. It has three columns as follows -: id INT UNSIGNED NOT NULL AUTO_INCREMENT
, share_src VARCHAR(30) NULL
, creator INT UNSIGNED NOT NULL
.
I also have a function called checkSrc
which returns no
or yes
when a share_src is provided to it as a parameter.
I want to return all the rows where creator is 10
AND (share_src is null
or
the result from the function checkSrc is yes
).
Currently i am doing this
SELECT * FROM unzip WHERE creator = 12 AND (share_src IS NULL || checkSrc(share_src) = 'yes');
But this results in an error. Whats the problem in the query? A lot thanks for help..