当前位置:   article > 正文

常用SQL查询

常用SQL查询

–查看表字段
select *
from user_tab_columns
where Table_Name = ?
order by column_name;

select *
from user_tab_columns
where Table_Name = ?
order by column_name;

–查看表的主键
select *
from user_cons_columns
where constraint_name = (select constraint_name
from user_constraints
where table_name = ?
and constraint_type = ?);

–查看字段注释
select * from user_col_comments where table_name = ?;

select * from ap_group_page where Parent_id like ?;

—查询数据库
SELECT count(*) from user_tables; –实体表

SELECT count(*) FROM user_views; –视图

SELECT COUNT(*) FROM user_triggers; –触发器

SELECT COUNT(*) FROM user_sequences; –序列

SELECT COUNT(*) FROM user_procedures; –存储过程

SELECT COUNT(*) FROM user_indexes; –索引

SELECT COUNT(*) FROM user_constraints; –约束

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/559821
推荐阅读
相关标签
  

闽ICP备14008679号