linq查询语法操作数应包含1列

prdp8dxp  于 2021-06-19  发布在  Mysql
关注(0)|答案(0)|浏览(277)

我有以下linq代码:

var count = (from ad in AccelerometerData
         join ae in AccelerometerEvents on ad.AccelerometerDataId equals ae.AccelerometerData.AccelerometerDataId
         where ad.Device.DeviceId == journey.Device.DeviceId && ae.TimeStamp >= journey.StartDateTime && ae.TimeStamp <= journey.EndDateTime
         select ae).Count();

当我运行代码时,它会给出错误:
mysql-操作数应包含1列
我正在使用mysql驱动程序在linqpad中运行代码。在将它放入应用程序之前,我正在linqpad中测试它。
从linqpad生成的sql如下所示:

SELECT COUNT(*)
FROM AccelerometerData AS t0
INNER JOIN AccelerometerEvent AS t1
  ON (t0.AccelerometerDataId = (
    SELECT t3.AccelerometerDataId, t3.DeviceId, t3.PacketId, t3.ReceivedDateTime, t3.StartDateTime
    FROM AccelerometerData AS t3
    WHERE (t3.AccelerometerDataId = t1.AccelerometerDataId)))
LEFT OUTER JOIN Device AS t2
  ON (t2.DeviceId = t0.DeviceId)
WHERE (((t2.DeviceId = 103) AND (t1.TimeStamp >= @p0)) AND (t1.TimeStamp <= @p1))

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题