Fetch the number of rows returned/affected by a SQL query

0

My use case is to fetch the number of rows returned/affected by a SQL query of Postgres/MYSQL RDS using the logs. Is there any configuration option?

1 Answer
0

This is an old school answer but you could do it with something like:

SELECT * FROM foo WHERE ... UNION ALL select count(*), NULL from foo WHERE ...;

The last row will contain the count of the query

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions