【发布时间】:2021-09-30 20:46:38
【问题描述】:
我正在尝试运行以下查询:
select U1.userEmail, U1.firstname + ' ' + U1.surName as fullname
from tblUser as U1 inner join tblDriver as D on U1.userEmail= D.userEmail
inner join tblGetAsk as GA on GA.userEmail = D.userEmail
where not exists (select 1 from tblRideRating as R where R.userEmail = U1.userEmail)
and count(GA.userEmail) >= 3
但我收到以下错误:
错误 1:无法准备语句(1 滥用聚合函数 计数())
我真正想做的是:只选择同时也是司机并且在tblRideRating中有0条记录,并且在tblGetAsk中至少有3条记录的用户。
【问题讨论】:
-
您使用的连接运算符
+在SQL Server 中有效,但错误消息似乎是SQLite。您使用哪个数据库?