我想取一个表的列的差异。我们的列名是 Planned_date 所以现在我想取这两列的差异
A = Planned_Date of stop1 - Planned_Date of stop5
所以我如何编写查询来获取下面 A 的值是我编写的示例查询,但不知何故它对我不起作用。
select (select planned_arrival as val1
from shipment_stop
where stop_num = 1
and shipment_gid = 'IFFCO/LOGISTICS.L171009358')
-
(select planned_arrival as val2
from shipment_stop
where stop_num = 5
and shipment_gid = 'IFFCO/LOGISTICS.L171009358')
请帮忙。