高手请帮忙,如何去除重复的值??
YFile 2003-05-12 05:38:53 举例~
一个页面是显示两种记录
1.列出存在于某一工作组的用户
2.列出不存在于某一工作组的用户
但由于用户可以存在于不同的组中,用sql语句时就可能出先两边都有同一个姓名,但不在同一组中..我想把如果在这个组中出现的用户就不去显示他了.可不可以请各位高手帮帮忙??数据库是mysql(不是orcale不能用子查询)
我现在用的sql语句是:
1.SELECT contact.id,contact.name from contact,grouper,contact_grouper where contact_grouper.gid='$gid' and contact_grouper.id=contact.id and contact_grouper.gid=grouper.gid
2.SELECT contact.id,contact.name from contact,grouper,contact_grouper where contact_grouper.gid!='$gid' and contact_grouper.id=contact.id and contact_grouper.gid=grouper.gid
gid为组的id,id为用户的id.