Home > database >  Database table structure
Database table structure

Time:09-15

Database display table structure is to use desc table name?
Still use to write something else

CodePudding user response:

Desc is up sqlplus command, you can use the dbms_metadata. Get_ddl function

CodePudding user response:

Select * from col can also view the column information

CodePudding user response:

Desc is in the select query, descending order according to a certain field; Do you want to view the table structure of a table, you can use the following query to see a table of table structure
SELECT tc OLUMN_NAME, T.D ATA_TYPE, T.D ATA_LENGTH, CASE T.N ULLABLE WHEN 'N' THEN 'no' WHEN 'Y' THEN 'is' END NULLABLE,
C.COM MENTS FROM USER_TAB_COLUMNS T, USER_COL_COMMENTS C
WHERE T.T ABLE_NAME=C.T ABLE_NAME AND tc OLUMN_NAME=Arthur c. OLUMN_NAME AND T.T ABLE_NAME=UPPER (' do you want to check the table name ')

CodePudding user response:

With this, the most professional, most comprehensive,
SELECT * FROM USER_TAB_COLUMNS T WHERE T.T ABLE_NAME='table' ORDER BY tc OLUMN_ID;
If the permission is enough big, can use ALL_TAB_COLUMNS or DBA_TAB_COLUMNS,

CodePudding user response:

Desc table name; Or show create table table name;
  • Related