I have been wondering why the following query doesn't work in PostgreSQL:
insert into store_to_storecatagory
values (select distinct storeid from store where store ILIKE 'Art etc',
select distinct storecatagoryid from storecatagory where
storecatagory ILIKE 'ARTS AND CURIOS');
The response I get is:
ERROR: syntax error at or near "select" at character 44
I know that the SELECT statements work fine. But I am not sure that they can be combined with an INSERT statement...
Your help is always appreciated. Thanks and best wishes,
(sorry about posting this on the MySQL forum previousely).
Hi, I found my solution with the help of a friend:
insert into store_to_storecatagory (storeid, storecatagoryid) (select distinct storeid, storecatagoryid from store, storecatagory where store ILIKE 'Art etc%' and storecatagory ILIKE 'ARTS AND CURIOS')