oracle 查看表字段及注释信息

SELECT A.TABLE_NAME 表名称,

C.COMMENTS 表注释,

A.COLUMN_NAME 字段名称,

REPLACE(DECODE(A.DATA_TYPE,

‘DATE‘,

‘DATE‘,

‘VARCHAR2‘,

‘VARCHAR2(‘ || A.DATA_LENGTH || ‘)‘,

‘NUMBER‘,

‘NUMBER(‘ || A.DATA_PRECISION || ‘,‘ || A.DATA_SCALE || ‘)‘,

A.DATA_TYPE),

‘,0‘,

‘‘) 字段类型,

b.COMMENTS 注释

FROM USER_TAB_COLUMNS A, USER_COL_COMMENTS B, USER_TAB_COMMENTS C

WHERE A.COLUMN_NAME = B.COLUMN_NAME

AND A.TABLE_NAME = B.TABLE_NAME

AND A.TABLE_NAME = C.TABLE_NAME and A.TABLE_NAME=表名

查看所有表结构的话把红色部分去掉

时间: 2024-10-10 08:49:15

oracle 查看表字段及注释信息的相关文章

ORACLE 按表字段值的不同统计数量

select p.id comperitorId,p.compcorp competitorName, sum(case when c.kindname = 'ATM' then c.num else 0 end) atm, sum(case when c.kindname = 'CRS' then c.num else 0 end) crs, sum(case when c.kindname = 'VTM' then c.num else 0 end) vtm, sum(case when c

oracle怎么查看表字段的类型

select column_name,data_type,DATA_LENGTH From all_tab_columns where table_name=upper('表名') AND owner=upper('数据库登录用户名') select column_name,data_type,DATA_LENGTH From all_tab_columns where table_name=upper('Mid_Payinfo') AND owner=upper('cgtest') creat

oracle用户表字段注释

SELECT C.TABLE_NAME,NUM_ROWS,(select COMMENTS from user_tab_comments WHERE TABLE_NAME=C.TABLE_NAME) AS TABLE_COMMENTS,COLUMN_NAME,D.COMMENTS AS COLUMN_COMMENTSFROM user_tables C ,user_col_comments D WHERE C.NUM_ROWS>0 AND C.TABLE_NAME=D.TABLE_NAME

oracle修改表字段名时报错:ORA-00054:资源正忙,但指定以NOWAIT方式获取资源,或者超时失效的问题

打开sql plus select session_id from v$locked_object;查询出oracle锁定的会话ID SELECT sid, serial#, username, osuser FROM v$session where sid = 1; 查询出当前会话数的信息 ALTER SYSTEM KILL SESSION '200,2141'; 杀掉当前会话 注:'200,2141'是:SID和SERIAL字段进行拼接的

oracle查看当前登陆的用户信息

查看当前登陆的用户名: select user from dual; 或者 select * from user_users; 或者 show user 查看当前用户拥有的角色和权限: select * from user_role_privs; select * from session_privs;

oracle查看表结构和注释

查看表结构: 看字段名与数据类型     select   *   from   cols     WHERE   TABLE_name=upper( 'table_name ') 查看主键:     select   *   from   user_constraints   where   constraint_type= 'P '     and   TABLE_name=upper( 'table_name ') 另外: 在SQLPLUS中,用     desc   tablename 

如何给表字段添加描述信息

-----------创建表空间 create tablespace auctionDB datafile 'E:\OracleDB\System_TableSpace\auctionDB.dbf' size 10M Autoextend on ------------删除表空间 drop Tablespace auction ------------删除约束 alter table auctionRecord drop constraint FK_rec_REF_user; ---------

Hibernate为表字段添加备注信息,便于理解数据库设计

java实体类,可以加上字段的描述,是个好的习惯吧,便于理解数据库设计,为后期维护,升级,改造提供支持

获取mysql数据库表字段的备注信息

SELECT COLUMN_NAME as field_name , COLUMN_COMMENT as remark  FROM information_schema.COLUMNS WHERE TABLE_NAME = 'your_table_name'   原文地址:https://www.cnblogs.com/hinq/p/12024094.html