白日梦 于 16-4-2005 08:47 AM 说 :
SQL DISTINCT * FROM TABLE ORDER BY ADDRESS GROUP BY ADDRESS
坛主,我试了你的方法还是不能!
SQL> select DISTINCT * from patient ORDER BY address GROUP BY address;
select DISTINCT * from patient ORDER BY address GROUP BY address
*
ERROR at line 1:
ORA-00933: SQL command not properly ended
它的题目是这样的:
The hospital has prepared a survey to be sent to each patient. To save postage they wish to identify pairs of patients who live at the same address.
Name Null? Type
----------------------------------------- -------- ------------------------
PATIENTID NOT NULL CHAR(4)
SURNAME NOT NULL VARCHAR2(15)
GIVENNAMES VARCHAR2(15)
ADDRESS VARCHAR2(40)
PHONE VARCHAR2(15)
DATEOFBIRTH DATE
GENDER CHAR(1)
可能是我的翻译的不对,请多多包涵!
[ Last edited by sun_kid on 16-4-2005 at 07:18 PM ]