数据库查询不包含某个字段的表

SELECT
	table_name,
	column_name 
FROM
	information_schema.COLUMNS 
WHERE
	table_schema = 'database1' 
	AND table_name NOT IN ( SELECT table_name FROM information_schema.COLUMNS WHERE table_schema = 'database1' AND column_name = 'sss_id' GROUP BY table_name ) 
	AND table_name NOT LIKE 'ppp_%' 
	AND table_name NOT LIKE 'aaa_%' 
	AND table_name NOT LIKE 'bbb_%' 
	AND table_name NOT LIKE 'ccc_%' 
GROUP BY
	table_name;

查询不包含sss_id的表

    原文作者:zh_39446980
    原文地址: https://blog.csdn.net/weixin_39446980/article/details/108058974
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞