Mysql 存儲過程查詢結果賦值到變量的方法

把查詢結果賦值到變量,大部分狀況下使用遊標來完成,可是若是明確知道查詢結果只有一行(例如統計記錄的數量,某個字段求和等),其實可使用set或into的方式來實現賦值。示例代碼:sql drop table if exists test_tbl; create table test_tbl (name varchar(20), status int(2)); insert into test_tbl
相關文章
相關標籤/搜索