Oracle
 sql >> Datenbank >  >> RDS >> Oracle

Möchten Sie die Differenz von zwei Spalten in Sql nehmen

Versuchen Sie Folgendes -

SELECT
    s1.planned_arrival - s2.planned_arrival AS val
FROM
    shipment_stop s1,
    shipment_stop s2
WHERE
    s1.stop_num = 1
    AND s2.stop_num = 5
    AND s1.shipment_gid = 'IFFCO/LOGISTICS.L171009358'
    AND s1.shipment_gid = s2.shipment_gid;