Oracle那些不常用的SQL

来源:互联网 发布:2017淘宝电商品牌排行 编辑:程序博客网 时间:2024/06/05 02:53

获取主键的SQL语句
select col.column_name from user_constraints con, user_cons_columns col where con.constraint_name=col.constraint_name and con.constraint_type='P' and col.table_name='MM_PUB_OFFER'
其参数为col.table_name 后面跟着的表名

查询一个表的列数

select count(*)from user_tab_columnswhere table_name = upper('wf_tbl_template');
其参数 wf_tbl_template 为表名


0 0
原创粉丝点击