Hello Dear Friends,
I am learning C# winapp and i want to create a query with three tables. I know how to join two tables with inner join but i got error while doing the same with three tables.
here is my tables structure...
1.Table Employee
EmpName Text
EmpAdd Text
EmpCityId Number
EmpStatId Number
2.Table MasterCity
CityId Number
StateId Number
City Text
3.Table MasterState
StateId Number
State Text
I want to get a record from employee table. How can I join three tables that give me a full record of an employee with name, address, city and state?
EmpName Text
EmpAdd Text
EmpCityId Number
EmpStatId Number
2.Table MasterCity
CityId Number
StateId Number
City Text
3.Table MasterState
StateId Number
State Text
I want to get a record from employee table. How can I join three tables that give me a full record of an employee with name, address, city and state?
I am trying with > Select Employee.empname, Employee.empadd, Mastercity.city, Masterstate.state from Employee inner join mastercity on Employee.empcityid=
mastercity.cityid inner join employee.empstateid=masterstate.stateid Where Employee.EmpName='PINAKIN T SHAH'
mastercity.cityid inner join employee.empstateid=masterstate.stateid Where Employee.EmpName='PINAKIN T SHAH'
Please help out with how to correct the query? How to join three tables?
Thank You
Mayank Jani
Amit GuptaPosted Aug 25, 2017, 2:42 AM
Mayank JaniPosted Aug 31, 2017, 8:51 AM
Amit GuptaPosted Aug 31, 2017, 3:09 AM
Mayank JaniPosted Aug 31, 2017, 1:37 AM
Amit GuptaPosted Aug 30, 2017, 5:23 AM
Mayank JaniPosted Aug 30, 2017, 2:50 AM
issacpalPosted Aug 29, 2017, 1:54 AM
Mayank JaniPosted Aug 25, 2017, 1:59 PM
Mayank JaniPosted Aug 25, 2017, 1:17 PM
Puneet KankarPosted Aug 25, 2017, 1:08 PM
Sudheshwer RaiPosted Aug 25, 2017, 3:33 AM
Mayank JaniPosted Aug 25, 2017, 2:19 AM
EmpName Text >ABC XYZ
EmpAdd Text >0, Somewhere, here and there.
EmpCityId Number >3
EmpStatId Number >2
2.Table MasterCity
CityId Number >3
StateId Number >2
City Text >Ahmedabad
3.Table MasterState
StateId Number >2
State Text >Gujarat
Mayank JaniPosted Aug 25, 2017, 2:09 AM
Amit GuptaPosted Aug 24, 2017, 2:36 PM