sql-查询一个字段相同另一个字段不同
SELECT DISTINCT a.fullname, a.belong_user_id AS belong_id, a.store_type FROM c_store_tbl a JOIN c_store_tbl b ON a.store_type != b.store_type WHERE a.belong_user_id = b.belong_user_id ORDER BY a.belong_user_id, a.store_type
SELECT DISTINCT a.fullname, a.belong_user_id AS belong_id, a.store_type FROM c_store_tbl a JOIN c_store_tbl b ON a.store_type != b.store_type WHERE a.belong_user_id = b.belong_user_id ORDER BY a.belong_user_id, a.store_type