Syntax error

I am trying to insert records into one table based on a selection from another table for the key and then using a constant as the value, all based on select conditions in table 2. So far I have

insert into table1 (cuisine, venueid) select ‘constant’, RestId from table2 left outer join on table1.venueid = table2.RestId where Cuisines like ‘%American (Traditional)%’ or Cuisines like ‘%Hot Dogs%’ or Cuisines like ‘%Hamburgers%’

Cuisines is a unique field name in table 2.

INSERT
  INTO table1 
     ( cuisine
     , venueid ) 
SELECT 'constant'
     , RestId 
  FROM table2 
 WHERE Cuisines LIKE '%American (Traditional)%' 
    OR Cuisines LIKE '%Hot Dogs%' 
    OR Cuisines LIKE '%Hamburgers%'

i don’t see how your LEFT OUTER JOIN was required so i took it out

:slight_smile:

Maybe to be a little more clear, I want to do a select on table 2, which is the like clauses, to return all the key id values where they exist in tabl2 and then insert records into table 1 for all those key values with the associated value in the other field being the string constant.

Also, Cuisines is a text field in table2 and may contain 1, 2, or all 3 of the values in the where clause

never mind, I got it.

Yep, that’s it. Thanks for the reply.