查询表格字段,字段类型,并过滤处理
2018-10-21 18:26 更新
SELECT
COLUMN_NAME AS name,
data_type AS type,
(
CASE
WHEN LEFT (data_type, 4) = 'char' THEN 'String'
WHEN LEFT (data_type, 4) = 'doub' THEN 'float'
WHEN LEFT (data_type, 4) = 'inte' THEN 'int'
WHEN LEFT (data_type, 4) = 'time' THEN 'Date'
else data_type END
) AS type
FROM
information_schema. COLUMNS
WHERE
TABLE_NAME = 't_bridge'
ORDER BY
ordinal_position;
以上内容是否对您有帮助:
更多建议: