一行里有A,B,C三个字段,我想根据 A字段来 选取不重复的ROW怎么处理 我用SELECT DISTINCT A,B,C FROM table WHERE A='张三'; 怎么还是把所有A字段重复的都选出来了, 难道DISTINCT不支持多个字段的,只能选取一个字段的么? 有什么办法解决呢?
set @id:=0; select (@id:=@id+1) as sortid,applydate from item order by applydate mysql> set @id:=0; Query OK, 0 rows affected (0.00 sec) mysql> select (@id:=@id+1) as sortid,applydate from item order by applydate; +--------+---------------------+ | sortid | applydate | +--------+---------------------+ | 1 | 2007-10-24 15:48:54 | | 2 | 2007-10-25 13:24:22 | | 3 | 2007-10-2...