insert into select with union needs derived table Why do I need to do another select when I am trying to insert distinct values into a table? Also: is there a better way to do this?

WORKS:

INSERT INTO phppos_categories (name) 
SELECT category FROM 
    (SELECT DISTINCT category FROM phppos_items as items 
    UNION 
    SELECT DISTINCT category FROM phppos_item_kits as item_kits) 
as category_result;


DOESN'T WORK:

INSERT INTO phppos_categories (name) 
    (SELECT DISTINCT category FROM phppos_items as items 
    UNION 
    SELECT DISTINCT category FROM phppos_item_kits as item_kits)
Try this it will work

INSERT INTO phppos_categories (name) 
SELECT DISTINCT category FROM phppos_items 
UNION 
SELECT DISTINCT category FROM phppos_item_kits