Joining 4 Tables in SQL Server
-
Hi Friends I have to join 4 tables in SQL Server and need to Show Specific Coulmns in Data Grid View From First Table User Tabel and feild User_ID, User_Name, User_Email, User_Password, UserR_ID, UserS_ID, Co_ID, User_Remark from Second Table User_right Tabel and feild UserR_ID, User_Right .from third Table User_Status Tabel and feild UserS_ID, User_Status From Fourth Table Company and feild Co_ID, Co_Name From First Table i need to show User_ID, User_Name, User_Email, User_Password, User_Remark 2.from Second Table i need to show User_Right 3.from third Table i need to show User_Status 4.From Fourth Table i need to show Co_Name Try to Reply to this as soon as possible Friends...Thanks..
-
Hi Friends I have to join 4 tables in SQL Server and need to Show Specific Coulmns in Data Grid View From First Table User Tabel and feild User_ID, User_Name, User_Email, User_Password, UserR_ID, UserS_ID, Co_ID, User_Remark from Second Table User_right Tabel and feild UserR_ID, User_Right .from third Table User_Status Tabel and feild UserS_ID, User_Status From Fourth Table Company and feild Co_ID, Co_Name From First Table i need to show User_ID, User_Name, User_Email, User_Password, User_Remark 2.from Second Table i need to show User_Right 3.from third Table i need to show User_Status 4.From Fourth Table i need to show Co_Name Try to Reply to this as soon as possible Friends...Thanks..
What have you tried, this seems to be a very simple exercise in organising your joins. Table 1 has all the foriegn keys to the other tables.
Never underestimate the power of human stupidity RAH
-
What have you tried, this seems to be a very simple exercise in organising your joins. Table 1 has all the foriegn keys to the other tables.
Never underestimate the power of human stupidity RAH
can you do for me i am new i have tried but i can not
-
can you do for me i am new i have tried but i can not
https://startpage.com/do/search?query=sql+server+join[^] This is basic SQL; reading any of those listed sites would explain in a few minutes how to do so.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
can you do for me i am new i have tried but i can not
Lets see what you have tried and we will try and correct it.
Never underestimate the power of human stupidity RAH
-
Lets see what you have tried and we will try and correct it.
Never underestimate the power of human stupidity RAH
SELECT UserT.User_ID, UserT.User_Name, UserT.User_Email, UserT.User_Password, UserRightT.User_Right, UserStatusT.UserStatus, CompanyT.Co_Name, UserT.User_Remark
FROM CompanyT INNER JOIN
UserT ON CompanyT.Co_ID = UserT.Co_ID CROSS JOIN
UserStatusT CROSS JOIN
UserRightTquery work but record again agai show in grid
-
SELECT UserT.User_ID, UserT.User_Name, UserT.User_Email, UserT.User_Password, UserRightT.User_Right, UserStatusT.UserStatus, CompanyT.Co_Name, UserT.User_Remark
FROM CompanyT INNER JOIN
UserT ON CompanyT.Co_ID = UserT.Co_ID CROSS JOIN
UserStatusT CROSS JOIN
UserRightTquery work but record again agai show in grid
I'm pretty sure you should replace the cross joins with either inner or left joins. Read this article [^]to help understand the joins. Displaying the data in a grid is NOT a database problem, choose the correct forum (web/wpf/winforms) to get support on the UI.
Never underestimate the power of human stupidity RAH
-
I'm pretty sure you should replace the cross joins with either inner or left joins. Read this article [^]to help understand the joins. Displaying the data in a grid is NOT a database problem, choose the correct forum (web/wpf/winforms) to get support on the UI.
Never underestimate the power of human stupidity RAH
thank you