murtuzakothawala
murtuzakothawala

Reputation: 182

Insert the value in a table taking from another table

I have 2 table tab1 and tab2. In tab1 i am storing the user_id and quiz_id(quiz_id is primary key) and in the tab2 i want to store the question for the quiz where quiz_id is the same for user_id in second table

Upvotes: 0

Views: 51

Answers (1)

juergen d
juergen d

Reputation: 204746

insert into tab2    
    (select quiz_id from tab1 where user_id = 123), ...

Upvotes: 1

Related Questions