I am trying to run a conditional insert statement but running to issues. Here the statement:
insert into category_content (category_id, content_id, content_type_id, priority) (select 29, id, 1, 1 from article where blog_id = 80)
where not exists(
select * from category_content where category_id = 29 and firstname in (select id from article where blog_id = 80)
);
This is the error I get:
ERROR: syntax error at or near "where"
LINE 2: where not exists(
^
********** Error **********
ERROR: syntax error at or near "where"
SQL state: 42601
Character: 153