osyris zosar

osyris zosar

  • NA
  • 289
  • 27k

Inserting collums data from 3 different tables into new table

Mar 28 2021 7:12 AM
I have 3 table,
 
table: "db.Users"
has columns: UserId, FirstName, Lastname, Email
 
table: "db.Roles"
has columns:  RolesId, RoleName 
 
Table: "db.UserRoles" 
Has columns:  UserId, RolesId
 
And I would like to Insert the information from the top
3 tables into a new existing table named
Table: "db.UsersWithRoles" 
 
with  5 columns:  UserId, FirstName, Lastname, Email, RoleName
 
 
I have tried to use  Inner join but it is not really what i was looking for 
because i want to add it to an existing table so i can read it with C# mvc and post it on my website
I am not really sure how I am able to achive this.
 

Answers (4)