Prerequisite oralce, mybatis
Now there are multiple tables
I now need to count the amount of information in each table, that is, count(*)
My current method is to write multiple methods
For example, in mapper:
long selectCountA;
long selectCountB;
long selectCountC;
In this case, I have to check it three times in the database. Obtain 3 pieces of data respectively
I wonder if I can write a sql statement to directly obtain three values
Solution?
. Can you give me an oracle statement? It's all mysql. .
Use multi-column writing method
Like this?
Mysql
Oracle
after the above statementAdd from dual
Mysql
select table_rows from information_schema.TABLES where table_schema in ('schema1','schema2','scheman') and table_name in ('tableName1','tableName2','tableNameN')
I believe oralce also has a similar system table