Create table Client_Registration
(
Client_ID int,
Rad_ID int
);
INSERT INTO Client_Registration (Client_ID,Rad_ID)
VALUES ('1','1');
INSERT INTO Client_Registration (Client_ID,Rad_ID)
VALUES ('2','1');
INSERT INTO Client_Registration (Client_ID,Rad_ID)
VALUES ('3','2');
INSERT INTO Client_Registration (Client_ID,Rad_ID)
VALUES ('4','2');
INSERT INTO Client_Registration (Client_ID,Rad_ID)
VALUES ('1','1');
select client_id,distinct Rad_ID from Client_registration
ORDER BY client_id, Rad_ID;
我必须从表中找到不同的 R_ID