Anti-Rich
Well-known member
hi everyone,
i have a question relating to inner joins. i know that an inner join is used to join two tables
in order to get relating data between them, but i have a table which has three fields which
can get data from 3 other tables, none of which relate to each other (therefore, i would think,
eliminating an inner join within an inner join), so can anyone show me how to do this properly,
because the query i have below returns 3 rows, when i know there is only one.
cheers all
adam
i have a question relating to inner joins. i know that an inner join is used to join two tables
in order to get relating data between them, but i have a table which has three fields which
can get data from 3 other tables, none of which relate to each other (therefore, i would think,
eliminating an inner join within an inner join), so can anyone show me how to do this properly,
because the query i have below returns 3 rows, when i know there is only one.
VB.NET:
[SIZE=2][COLOR=#0000ff]SELECT[/COLOR][/SIZE][SIZE=2] h[/SIZE][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][SIZE=2]HazNo[/SIZE][SIZE=2][COLOR=#808080],[/COLOR][/SIZE][SIZE=2] h[/SIZE][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][SIZE=2]LocationID[/SIZE][SIZE=2][COLOR=#808080],[/COLOR][/SIZE][SIZE=2] h[/SIZE][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][SIZE=2]BuildingID[/SIZE][SIZE=2][COLOR=#808080],[/COLOR][/SIZE][SIZE=2] h[/SIZE][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][SIZE=2]EmployeeID[/SIZE][SIZE=2][COLOR=#808080],[/COLOR][/SIZE][SIZE=2] e[/SIZE][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][SIZE=2]FirstName[/SIZE][SIZE=2][COLOR=#808080],[/COLOR][/SIZE][SIZE=2] e[/SIZE][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][SIZE=2]LastName [/SIZE]
[SIZE=2][COLOR=#0000ff]FROM[/COLOR][/SIZE][SIZE=2] tblHazRegister h[/SIZE][SIZE=2][COLOR=#808080],[/COLOR][/SIZE][SIZE=2] tblBuildingLocation b[/SIZE][SIZE=2][COLOR=#808080],[/COLOR][/SIZE][SIZE=2] tblEmployee e [/SIZE][SIZE=2][COLOR=#0000ff]WHERE[/COLOR][/SIZE][SIZE=2] h[/SIZE][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][SIZE=2]HazNo [/SIZE][SIZE=2][COLOR=#808080]=[/COLOR][/SIZE][SIZE=2]0 [/SIZE][SIZE=2][COLOR=#808080]AND[/COLOR][/SIZE][SIZE=2] e[/SIZE][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][SIZE=2]EmployeeID [/SIZE][SIZE=2][COLOR=#808080]=[/COLOR][/SIZE][SIZE=2] h[/SIZE][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][SIZE=2]EmployeeID[/SIZE]
cheers all
adam