I have two tables, first is accounts
and second is client
. When client signs up, then I have to insert his email and password into accounts
table and his other information into client
table with newly created foreign key of accounts
table. Why is my this query is not running?
INSERT INTO client (account_id, name, horoscope, credit, receive_email)
VALUES
(INSERT INTO accounts(email, password, user_type)
OUTPUT inserted.id
VALUES ('test@example.com', 12, 0),
'name', 'Libra', 0.0, 0);
What can I do in this scenario to insert data in two tables with single query?