|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
各位大神,晚上好,请教一个ado+sql的问题,在mysql 里面调试通过的语句,微调后在ado里面不通过,
实在找不到原因,烦请大神帮忙看下
以下附上截图 和代码
mysql数据中的代码如下:
SELECT
t3.*,
t4.`Event Type`,
t4.`Laden(F)/Empty(E)`,
t4.`Curr Loc`
FROM
(
SELECT
t2.`Doc Ref`,
MAX( t2.`Event Datetime` ) AS `最大时间`
FROM
(
SELECT
t1.*
FROM
`国内港口含中文` AS t0
INNER JOIN `downloaddata at vlp1` AS t1 ON t0.`港口三字代码` = LEFT ( t1.`Curr Loc`, 3 )
WHERE
`Event type` IN ( 'Receive', 'Issue' )) t2
GROUP BY
t2.`Doc Ref`
) AS t3
INNER JOIN `downloaddata at vlp1` AS t4 ON t3.`Doc Ref` = t4.`Doc Ref`
AND t3.`最大时间` = t4.`Event Datetime`
GROUP BY
t3.`Doc Ref`
|
|