Imaging you have an basic statment
SELECT * FROM post_id WHERE wp_postmeta =2;
Open in new window
I know the
SET @variable. command but I want to set the whole statment do I have to use functions ?
or is there a way (which I tried) such as:
SET @variable = (SELECT * FROM post_id WHERE wp_postmeta =2);
Open in new window
then I can run the command using
SELECT @variable.