I'm having an issue while inserting a data to postgres table..
Here is my query:
INSERT INTO products (product_id, user_id)
SELECT id, (SELECT id FROM users WHERE c_id = _c_id) FROM product_badge WHERE comp_id = _comp_id;
Issue I'm receiving is
ERROR: more than one row returned by a subquery used as an expression CONTEXT
Thanks in advance
_c_idand_comp_id? What are you trying to achieve? You should give more context to your question, for example by providing sample data and expected results.