I have a SQL request that return some ora-01427 error:
single-row subquery returns more than one row
INSERT INTO my_table (value0, value1, value2, value3)
VALUES((SELECT MAX(value0) FROM my_table), '5', (SELECT DISTINCT(value2) FROM another_table), '8');
The thing is, I need two hard-coded values, I need a value from a select that returns only one row, and I want to do that for each row returned by a second select.
I feel like this query would work if only I had only one select. Is there a way to do multiple SELECT inside an INSERT ? What would be the syntax ?
EDIT : my_table and some_table are actually the same table, sorry for not being clear in the first place, actually, I need value0 to be unique so it needs to retrieve the biggest id each time, not just before the insertion but every time a new row is inserted.