0

我有下表

table x

labref   name  repeat_status
111      L          1
111      L          1
111      K          1
111      K          1
111      L          2
111      L          2
111      M          1
111      M          1

我需要的结果是

labref   name  repeat_status
111      L          1
111      L          2
111      K          1
111      M          1

我已经尝试过这个查询,但它没有带来结果,需要调整

SELECT name, repeat_status
FROM `x`
WHERE labref = '111'
GROUP BY repeat_status;

建议!

4

4 回答 4

1
 select DISTINCT labref ,name, repeat_status
 FROM x
 WHERE labref = '111'

此查询将获得您正在寻找的结果。

于 2013-08-26T13:59:04.517 回答
0
     SELECT name, repeat_status
     FROM `x`
     WHERE labref = '111'
     GROUP BY name ,repeat_status;
于 2013-08-26T14:04:59.177 回答
0
SELECT  labref,name,repeat_status
FROM `x`
WHERE labref = '111'
GROUP BY name,repeat_status;
于 2013-08-26T13:54:52.627 回答
0
SELECT name, repeat_status
FROM `x`
WHERE labref = '111'
GROUP BY name,repeat_status;
于 2013-08-26T14:09:42.343 回答