您能否将我引导到与Oracle中此查询等效的内容:
SELECT SQL_CALC_FOUND_ROWS * FROM tableName SELECT FOUND_ROWS() as cnt
谢谢
查询从中检索所有行tableName,然后在中检索行数tableName。这样做SQL_CALC_FOUND_ROWS只是性能优化:它使您不必进行两次查询。
tableName
SQL_CALC_FOUND_ROWS
如果性能不是问题,那么Oracle的等效项将是:
SELECT * FROM tableName SELECT count(*) from tableName
如果您可以重写客户端,则可以在一个查询中执行以下两项操作:
SELECT * , (SELECT count(*) from tableName) as totalRows FROM tableName