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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南