,CASE
WHEN a1.data_precision IS NULL THEN a1.data_type||'('||a1.data_length||')'
ELSE a1.data_type||'('||a1.data_length||','||a1.data_precision||')'
END AS 字段属性
,CASE
WHEN a2.comments IS NULL THEN '未知'
ELSE a2.comments
END AS 字段描述
FROM USER_TAB_COLUMNS a1
LEFT JOIN USER_COL_COMMENTS a2
ON a1.table_name = a2.table_name
AND a1.column_name = a2.column_name
WHERE a1.table_name = upper(
'so_creditaudit' -- 填写表名
)
ORDER BY a1.column_id
-----------------------------------------------------------------------------