列出发货延迟最长的订单的发货城市和州
我尝试了以下但无法显示:
TRENTON NJ 4
作为查询需要返回的唯一结果。
select shipcity, shipstate, shipdate-orderdate "Shipping Delay"
from orders
having max(shipdate-orderdate) >any (select shipdate-orderdate
from orders
where shipdate is not null)
group by shipcity, shipstate, shipdate-orderdate;