postgresql

SELECT a.atnum AS "id ", -- c. relname AS" id ", --CAST (obj_description (relfilenode, 'pg_class') AS VARCHAR) AS "table name description ", a.ttname AS" column name ", a.ttnotnull AS null, --IF(a.ttnotnull ='f',' yes ',' no ') AS 'Mandatory ', Concat_ws (", t.typname, SUBSTRING (format_type (a.attypID, a.attypmod) FROM '\(.*\)')) AS ", Pg_class C, pg_attribute A, pg_type T, Pg_description d WHERE c.elName = 'Actual table name' AND A.atttnum > 0 AND a.attrelid = c.id AND a.attttypID = t.id AND d.objoid = A.attrelid AND d.objsubid = A.attnum ORDER BY C.relname DESC, A.attnum ASCCopy the code

Mysql

SELECT COLUMN_COMMENT, COLUMN_NAME, COLUMN_TYPE data type, IS_NULLABLE specifies whether to allow null values FROM information_schema. COLUMNS where -- mysql specifies the database name, Table_schema ='mydatabasename' AND -- table_name ='mydatabasename' AND -- table_name ='mydatabasename' AND -- table_name ='mydatabasename' So you might not know which fields are in which table table_name = 'index'Copy the code