You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would be super helpful for parsing more advanced SQL select statements, like:
SELECT DATE_TRUNC('month', o.order_date) AS month, c.customer_id, c.customer_name, p.product_name, SUM(oi.quantity * oi.unit_price) AS revenue, ROW_NUMBER() OVER (PARTITION BY DATE_TRUNC('month', o.order_date), c.customer_id ORDER BY SUM(oi.quantity * oi.unit_price) DESC) AS revenue_rank FROM orders o JOIN customers c ON o.customer_id = c.customer_id JOIN order_items oi ON o.order_id = oi.order_id JOIN products p ON oi.product_id = p.product_id WHERE o.order_date >= '2022-01-01' AND o.order_date <= '2022-12-31' GROUP BY DATE_TRUNC('month', o.order_date), c.customer_id, c.customer_name, p.product_name
Having the last column auto-resolve to 'revenue_rank' would be SUPER helpful.
P.S: Does anyone know of any techniques to do this right now? I'm trying to design a solution from scratch using string indexing, but it's been extremely challenging
The text was updated successfully, but these errors were encountered:
This would be super helpful for parsing more advanced SQL select statements, like:
SELECT DATE_TRUNC('month', o.order_date) AS month, c.customer_id, c.customer_name, p.product_name, SUM(oi.quantity * oi.unit_price) AS revenue, ROW_NUMBER() OVER (PARTITION BY DATE_TRUNC('month', o.order_date), c.customer_id ORDER BY SUM(oi.quantity * oi.unit_price) DESC) AS revenue_rank FROM orders o JOIN customers c ON o.customer_id = c.customer_id JOIN order_items oi ON o.order_id = oi.order_id JOIN products p ON oi.product_id = p.product_id WHERE o.order_date >= '2022-01-01' AND o.order_date <= '2022-12-31' GROUP BY DATE_TRUNC('month', o.order_date), c.customer_id, c.customer_name, p.product_name
Having the last column auto-resolve to 'revenue_rank' would be SUPER helpful.
P.S: Does anyone know of any techniques to do this right now? I'm trying to design a solution from scratch using string indexing, but it's been extremely challenging
The text was updated successfully, but these errors were encountered: