Declaring and using MySQL varchar variables

前端 未结 4 851
醉话见心
醉话见心 2021-02-11 21:18

I\'m trying to do some simple manipulations with variables in MySQL 5.0 but I can\'t quite get it to work. I\'ve seen many (very!) different syntaxen for DECLARE/SET, I\'m not

4条回答
  •  独厮守ぢ
    2021-02-11 21:57

    try this:

    declare @foo    varchar(7),
            @oldFoo varchar(7)
    
    set @foo = '138'
    set @oldFoo = '0' + @foo
    

提交回复
热议问题