Can you please guide me to the equivalent to this query in Oracle:
SELECT SQL_CALC_FOUND_ROWS * FROM tableName
SELECT FOUND_ROWS() as cnt
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The query retrieves all rows from
tableName, and then retrieves the number of rows intableName. Doing that withSQL_CALC_FOUND_ROWSis just a performance optimization: it saves you from doing two queries.If performance is not an issue, an equivalent for Oracle would be:
If you are in a position to rewrite the client, you could do both in one query: