我有以下表SELECT DISTINCT *错误的MySQL
mysql> select * from abc;
+---+------+------+
| A | B | C |
+---+------+------+
| 2 | 2 | 2 |
| 1 | 2 | 3 |
| 3 | 3 | 2 |
| 4 | 3 | 3 |
+---+------+------+
4 rows in set (0.00 sec)
mysql> select count(distinct *)
-> from abc
-> group by a;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '*)
from abc
group by a' at line 1
任何人都可以让知道的上述查询正确的语法?
* what * query的正确语法?你之后有什么结果?也许你只是想用'B,C'替换'*' - 但是你想实现的模糊不清。 – eggyal
@eggyal我想获得表中的记录数。 –
当然,你正在努力做的不仅仅是这些,否则你就不会有'独特'和'被a'分组? – eggyal