SQL 语句执行后同步返回结果条数

PgSQL

SELECT COUNT(*) OVER() AS res_count FROM table WHERE ...

 

MySQL

mysql> SELECT SQL_CALC_FOUND_ROWS * FROM ... ;
mysql> SET @rows = FOUND_ROWS();

  

posted @ 2018-09-06 17:50  Ryan_zheng  阅读(1740)  评论(0编辑  收藏  举报