1.mysql
SELECT table_name FROM information_schema.TABLES where table_schema='数据库'
2.db2
SELECT tabname as table_name FROM syscat.tables where tabschema=current schema
3.sqlserver
select name as table_name from sysobjects where xtype='U'
4.oracle
select table_name from user_tables where table_name like 'bcs_log_log_oss_%'"
跨数据库查询表名技巧
本文介绍了如何在四种不同的数据库环境中(MySQL、DB2、SQL Server 和 Oracle)使用 SQL 查询来获取当前数据库中的所有表名。针对每种数据库,提供了具体的 SQL 语句示例。

被折叠的 条评论
为什么被折叠?



