这是我的陈述:
SHOW FULL COLUMNS IN tbl_name WHERE NOT (
FIELD = 'col1' OR FIELD = 'col2'
)
我想将它减少到这样的程度,以便PHP代码更有效:
SHOW FULL COLUMNS IN tbl_name WHERE NOT (
FIELD = 'col1','col2'
)
答案 0 :(得分:1)
select COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME = 'tbl_name'
and COLUMN_NAME not in ('col1', 'col2')