需求场景:
现要查询某个库下50个表每个表的表名和对应的数据量,通过pLsql工具运行sql语句,可以以表格的形式展示(表明在左,对应的数据在右),也方便导入excel。

百度经验(注.表名必须用单引号,不可使用双引号):

select 'Customers' as tablename, count(*) as row_count from Customers union all select 'Orders' as tablename, count(*) as row_count from Orders  union all ……

我的两个表名:BANK_ACC, BANK_CONTRAL
组织查50个表的sql语句:

select 'BANK_ACC' as tablename, count(*) as row_count from BANK_ACC union all select 'BANK_CONTRAL' as tablename, count(*) as row_count from BANK_CONTRAL union all ...

结果展示(这种结果方便导入excel):
使用sql语句批量查询多个表的表名和表行数并导入excel

相关文章:

  • 2021-12-22
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-08
  • 2022-12-23
  • 2021-11-03
  • 2021-11-03
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
相关资源
相似解决方案