0

我正在选择行

SELECT `playerid` FROM `lb-world` WHERE replaced=50 AND type=0 >= 0.01

但在我的桌子上我有

playerid | replaced | type | date
12       | 50       | 0    | 2010
12       | 50       | 0    | 2011
12       | 50       | 0    | 2012

如何只选择一次?

4

3 回答 3

1

试试这个:

SELECT `playerid` FROM `lb-world` 
WHERE replaced=50 AND type=0
GROUP BY playerid, replaced, type

这应该是通用的。
无论如何,如果你确定你只想要 playerid,使用这个

SELECT DISTINCT playerid FROM lb-world
WHERE replaced=50 AND type=0
于 2012-08-01T12:54:48.737 回答
0

如果你只想要playerid,你可以使用DISTINCT

SELECT DISTINCT `playerid` FROM `lb-world` WHERE replaced=50 AND type=0 >= 0.01
于 2012-08-01T12:55:08.083 回答
0
SELECT DISTINCT playerid..

正如@Michael 所说

于 2012-08-01T12:55:32.117 回答