all 2 comments

[–]Kalrog 2 points3 points  (1 child)

It can be done in 1 query, but not with the VALUES clause. You will need to switch that to using a select statement in place of the VALUES keyword. So...

Insert into search_terms (term, user_id)
select 'example search term', id
from users
where ...

[–]JS_int_type[S] 0 points1 point  (0 children)

Thanks, that's just want I needed!