我有以下表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