Skip to content

Commit

Permalink
Time: 2040 ms (6.29%), Space: 0B (100.00%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
joseantoniochacon committed Jun 5, 2024
1 parent 56b49ab commit 1264622
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Write your MySQL query statement below
SELECT ROUND((SUM(IF(ddd.order_date = ddd.customer_pref_delivery_date,1,0))/COUNT(ddd.customer_id)*100),2) AS immediate_percentage FROM (SELECT d.customer_id, d.order_date, d.customer_pref_delivery_date FROM Delivery d JOIN (SELECT customer_id, MIN(order_date) AS order_date FROM Delivery GROUP BY customer_id) dd ON dd.customer_id = d.customer_id AND dd.order_date = d.order_date) ddd;

0 comments on commit 1264622

Please sign in to comment.