如何将表的行数赋值给变量(MySQL)

delimiter $$
drop procedure if exists test_at $$
create definer=root@localhost procedure test_at()
begin
declare i2 int default 0;
select count(*) into i2 from test_table;
select i2;
end $$
delimiter;

计算mysql表的函数,并且赋值给变量
这里是把值赋给i2的

原文地址:https://www.cnblogs.com/kyxyes/p/3477226.html