此sql命令:
SELECT pno,COUNT (DISTINCT sno) AS supplier_count FROM spj GROUP BY pno;
给我以下错误:错误1064(42000):您的sql语法有错误;检查与mysql服务器版本相对应的手册,以获得正确的语法,在第1行使用near'distinct sno)作为spj group by pno的供应商计数如何修复此错误?
pu3pd22g1#
移除 COUNT 以及 () :
COUNT
()
SELECT pno, COUNT(DISTINCT sno) AS supplier_count FROM spj GROUP BY pno;
1条答案
按热度按时间pu3pd22g1#
移除
COUNT
以及()
: