I have a table like: Table1 And I need to add a column to that table as average delivery time avr_del_time column added My code is:
SELECT a.vendor, a.part_nr, a.delivery_time, b.avr_del_time
FROM Table1 a
INNER JOIN (SELECT AVG(delivery_time) AS avr_del_time FROM Table1 GROUP BY vendor, part_nr) b
ON a.vendor = b.vendor, a.part_nr=b.part_nr
please guide me...