I have table C column names userid (uniqueidentifier), password,email,createdate. Table A has columns userid(uniqueidentifier),Email,Createdate and Table B has column name Password.
What query should i execute to get the results. ?
I have table C column names userid (uniqueidentifier), password,email,createdate. Table A has columns userid(uniqueidentifier),Email,Createdate and Table B has column name Password.
What query should i execute to get the results. ?
You can use a simple join between your table A and table B on the Primary key USER_ID
in a select statement inside your insert script.
Here is an sample script based on the information you provided:
INSERT INTO TABLE_C values (
select A.USER_ID,
A.PASSWORD,
B.EMAIL,
B.CREATED_DATE,
from TABLE_A A, TABLE_B B
where A.USER_ID = B.USER_ID
)
You can learn more on how to insert from a selected query here or here