How to declare a variable in MySQL for a normal query? -


how can declare variable normal query in mysql?

e.g.,

declare @myvar date; set @myvar = something;  select * sometable somecolumn = @myvar; 

i tried , syntax seems wrong...what missing?

you can declare session variable in way :

set @myvarname := 'value'; 

or local variable in way :

declare my_variable varchar(30) 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -