查询表格字段,字段类型,并过滤处理
sql语句:
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 type2
FROM
information_schema. COLUMNS
WHERE
TABLE_NAME = 't_bridge'
ORDER BY
ordinal_position;
结果: