我有以下代碼: select c.nome,(p.nome) as ultimo_produto
from cliente c
inner join compra cp on (c.cod_cli = cp.fk_cli)
inner join produto p on(cp.fk_pod=p.cod_pro)
where datc >=max(cp.datc)
group by c.n
SELECT DISTINCT CONCAT('TOTAL NUMBER OF LEGS IN A TRIP NUMBER ', T1.TNUM, ' IS NOT EQUAL TO THE LARGEST NUMBER OF LEG IN THE TRIP') AS 'ERR'
FROM TRIPLEG T1
WHERE MAX(T1.LEGNUM) = (SELECT COUNT(T2.T
以下是我正在嘗試運行的查詢。 select location_data.trip_code,sum(max(device_time)-min(device_time)) from location_data,trip_management
where location_data.source_id=3 and location_data.trip_code=trip_management.tri