How can I make a SELECT inside an INSERT operation?
insert into tableX (a_id, b_id) VALUES ((SELECT service_id FROM tableY WHERE id = 10, 2))
In MySQL one can insert dynamic values. Here is the sample:
MySQL
INSERT INTO Item_Info (`Back_Ground_Color`,) VALUES ( (select concat('#',SUBSTRING((lpad(hex(round(rand() * 10000000)),6,0)),-6))));