标签: sql-server tsql ssms distinct
我使用的是不同的值,但是代码不断向我返回2个具有相同值的ID……我该怎么办?
SELECT DISTINCT b.P_USERID as ID, a.P_GROUPNAME as ITEM, a.P_STATUS as STATUS FROM P_GROUPS AS a JOIN P_USERSINGROUPS AS b on a.P_GROUPID=b.P_GROUPID WHERE b.P_GROUPID NOT IN (100,101)