【发布时间】:2013-12-06 05:20:44
【问题描述】:
考虑这张表:
name mark1 mark2 mark3
x 1 2 2
y 2 2 2
z 1 2 3
在这里,我需要选择非不同的,例如考虑第三行,它在 column2 中只包含一个“2”。为此如何编写SQL代码?我已经使用了 count 和 distinct 命令,但无法获得它。
【问题讨论】:
-
描述你真正想要的
-
是的,让它更清楚......
-
count(distinct) 是有效表达式,请参考stackoverflow.com/questions/5737628/mysql-count-distinct