日期:2014-05-16 浏览次数:20854 次
SELECT COUNT( a.member_id ) AS sum, a.member_id FROM sdb_orders AS a LEFT JOIN sdb_members AS b ON ( a.member_id = b.member_id ) WHERE a.status <> 'dead' GROUP BY a.member_id HAVING COUNT( * ) >1
SELECT sum( a.member_id ) AS total, a.member_id FROM sdb_orders AS a LEFT JOIN sdb_members AS b ON ( a.member_id = b.member_id ) WHERE a.status <> 'dead' GROUP BY a.member_id HAVING COUNT( * ) >1