These are chat archives for eysteinn13/FraunhoferDBWebsite

20th
Jul 2015
Eysteinn Gunnlaugsson
@eysteinn13
Jul 20 2015 20:39
@Freyr12 er noob
code
code
SELECT MONTH(shipping_date), count(p.po_ID), ROUND(AVG(final_price), 2), ROUND(AVG(TOTAL_WEEKDAYS(shipping_date, receiving_date)), 2), ROUND(SUM(p.final_price), 2), c.customer_name
FROM pos p, customer c
WHERE p.customer_ID = c.customer_ID 
AND p.po_ID NOT IN (SELECT po_ID
                               FROM pos
                             WHERE shipping_date IS NULL) 
GROUP BY YEAR(shipping_date), MONTH(shipping_date) DESC;
SELECT MONTH(shipping_date), count(p.po_ID), ROUND(AVG(final_price), 2), ROUND(AVG(TOTAL_WEEKDAYS(shipping_date, receiving_date)), 2), ROUND(SUM(p.final_price), 2), c.customer_name FROM pos p, customer c WHERE p.customer_ID = c.customer_ID AND p.po_ID NOT IN (SELECT po_ID FROM pos WHERE shipping_date IS NULL) GROUP BY YEAR(shipping_date), MONTH(shipping_date) DESC;