在sql server 中可以实现declare @account int
set @account=(select count(id)from table_1)
print'account='+@account
在mysql中如何实现  请教高手

解决方案 »

  1.   

    declare account int;
    set account=(select count(id) from table_1);
    select concat('account=',account);
      

  2.   

    declare account int;
    select count(id)INTO account from table_1;
    SELECT CONCAT('account=',@account);
      

  3.   


    set @account=(select count(id)from table_1);
    SELECT CONCAT('account=',@account);
      

  4.   

    declare account int;
    select count(id)INTO account from table_1;
    SELECT CONCAT('account=',@account);