Want to take the difference of two columns in Sql

前端 未结 2 2025
抹茶落季
抹茶落季 2021-01-24 18:31

I want to take the difference of columns of a table.we have column name as Planned_date so now I Want to take the difference of these two columns

A = Planned_Dat         


        
2条回答
  •  没有蜡笔的小新
    2021-01-24 19:21

    Try this -

    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;
    

提交回复
热议问题