BOX8 | SQL Query on Regular Expression

Question

Write a query to find the difference between Time of Order and Time of Delivery.
Then check how many orders were delayed by more than 20,30,40,50 minutes

in progress 0
TheDataMonk 55 years 1 Answer 1070 views Grand Master 0

Answer ( 1 )

  1. select count(*) from table where TIMESTAMPDIFF(minute, Time of Order, Time of Delivery )>20;
    select count(*) from table where TIMESTAMPDIFF(minute, Time of Order, Time of Delivery )>30;
    select count(*) from table where TIMESTAMPDIFF(minute, Time of Order, Time of Delivery )>40;
    select count(*) from table where TIMESTAMPDIFF(minute, Time of Order, Time of Delivery )>50;

Leave an answer

Browse
Browse