1 MySQL
SELECT CONCAT(column_comment, "(", column_name, ")")
FROM information_schema.columns
WHERE table_schema ='my_db'
AND table_name = 'my_table'
ORDER BY ordinal_position;
查询建表语句
SHOW CREATE TABLE `dbname`.`t_product_position`;
2 Oracle 导出当前用户的表结构
通过查询当前用户的 user_tab_columns,user_col_comments, user_tab_comments 来获取表结构。
select A.TABLE_NAME as "表名",
C.COMMENTS AS "表说明",
A.COLUMN_ID AS "字段序号",
A.COLUMN_NAME AS "字段名",
B.COMMENTS AS