你试一下这一句是否可以 SELECT contact.id,contact.name from contact left join contact_grouper contact_grouper.id=contact.id where contact_grouper.gid!='$gid' 不在此工作组的用户。
试试:SELECT contact.id,contact.name from contact,grouper,contact_grouper where contact_grouper.gid='$gid' and contact_grouper.id=(select id from contact where contact.id and contact_grouper.gid=grouper.gid)
SELECT contact.id,contact.name from contact left join contact_grouper contact_grouper.id=contact.id where contact_grouper.gid!='$gid'
但是一个用户可能在多个组里,所以用!='$gid'还不够...
如果mysql能支持子查询就好了,再查一下该表的用户,不等用姓名就行了..
55555555555555,各位高手救命啊~
你试一下这一句是否可以
SELECT contact.id,contact.name from contact left join contact_grouper contact_grouper.id=contact.id where contact_grouper.gid!='$gid'
不在此工作组的用户。