如何將表的行數賦值給變量(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的


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM