Share
BOX8 | SQL Query on Regular Expression
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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
Answer ( 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;