我有这个查询
SELECT DISTINCT RE1.NAME AS NAME1,RE2.NAME AS NAME2
FROM RATING R1,RATING R2,REVIEWER RE1,REVIEWER RE2
WHERE R1.RID > R2.RID
AND R1.MID = R2.MID
AND RE1.RID = R1.RID
AND RE2.RID = R2.RID;
输出是
NAME1 NAME2
CHRIS BRITTANY
ASHLEY CHRIS
JAMES ELIZABETH
我想以行按字母顺序排列的方式返回表,即输出应该是:
NAME1 NAME2
BRITTANY CHRIS
ASHLEY CHRIS
ELIZABETH JAMES