查找所有学生没有重复的住址; SELECT DISTINCT O.address FROM StudentEJB AS O
select * from table1 group by col1 use distinct but not group by;)if you use 'count(*),col1' in your sql then add group by col1 at then end of sql.select distinct * from table1 --useage of distinct or select count(*),col1 from table1 group by col1 --useage of group by.
SELECT DISTINCT O.address FROM StudentEJB AS O
use distinct but not group by;)if you use 'count(*),col1' in your sql then add group by col1
at then end of sql.select distinct * from table1 --useage of distinct
or
select count(*),col1 from table1 group by col1 --useage of group by.