Mysql 判断字段存在
时间:2022-03-13 23:17
select count(*) > 1 from ( SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = ‘test‘ AND table_schema = ‘test‘ and COLUMN_NAME = ‘ID‘ ) v
时间:2022-03-13 23:17
select count(*) > 1 from ( SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = ‘test‘ AND table_schema = ‘test‘ and COLUMN_NAME = ‘ID‘ ) v