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 回答
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

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则