想比较一下,从表结构中除去已有的字段,结果出现问题。
SELECT column_name FROM information_schema.columns WHERE table_schema ='fhlc_stat' AND table_name = 'user_dimension_detail' AND column_name NOT IN (SELECT FIELD FROM fhlc_stat.`user_dimension` );
查了之后发现CONVERT(FIELD USING utf8) COLLATE utf8_unicode_ci
,用这个将需要的字段包裹起来就好了。
SELECT column_name FROM information_schema.columns WHERE table_schema ='fhlc_stat' AND table_name = 'user_dimension_detail' AND column_name NOT IN (SELECT CONVERT(FIELD USING utf8) COLLATE utf8_unicode_ci FROM fhlc_stat.`user_dimension` );