mysql列转行可以通过concat,先分组然后连接. show VARIABLES like '%group%' select @@group_concat_max_len SELECT GROUP_CONCAT(goods_id), as lzh FROM ts_goods WHERE ts_goods.cat_id_1 = OR ts_goods.cat_id_2 = OR ts_goods.cat_id_3 = group by lzh 这里默认的限制是1024字节,可以通过set调整一
Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, and all the friends do not want to stay
假设有两个表A,B,都只有一个字段PHONE 1,MINUS SELECT PHONE FROM A MINUS SELECT PHONE FROM B; 相当于用结果集A减去结果B得出的结果集.同样的效果也可以用SELECT PHONE FROM A WHERE NOT EXISTS(SELECT 1 FROM B WHERE A.PHOEN=B.PHONE)来达到. 2,INTERSECT SELECT PHONE FROM A INTERSECT SELECT PHONE FROM