CREATE DEFINER = 'qtfrad'@'%'
PROCEDURE JiuHeng.GetRecordCount(in tablename varchar(800),in sCondition varchar(500),out counts int)
BEGIN

 

set @strSQL=concat('select count(1) from ',tablename);

set @strSQL=concat(@strSQL,' where ',sCondition);


prepare sqlstmt from @strSQL;

set counts = @strSQL;


execute sqlstmt;

select counts;

deallocate prepare sqlstmt;


END

 

MYSQL存储过程获取记录总数

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-07-23
  • 2022-12-23
  • 2022-03-06
  • 2022-12-23
  • 2021-11-04
猜你喜欢
  • 2021-05-17
  • 2022-03-06
  • 2022-12-23
  • 2021-11-22
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案