How to declare a variable in MySQL?

后端 未结 7 1611
春和景丽
春和景丽 2020-11-22 05:01

How to declare a variable in mysql, so that my second query can use it?

I would like to write something like:

SET start = 1;
SET finish = 10;

SELECT         


        
7条回答
  •  灰色年华
    2020-11-22 05:45

    SET Value

     declare Regione int;   
     set Regione=(select  id from users
     where id=1) ;
     select Regione ;
    

提交回复
热议问题