aspdotnetuser
Programmer
Hi,
Any comments will be appreciated!
I have 4 tables, [blue]Branch, Client, User[/blue] and [blue]UserPreferredLocation.[/blue] Each client has multiple branches and a user has preferred branches they like to visit.
Currently, the query returns branches that require users and doesn't include branches that users like to visit. Is there any way I can modify the query to return all of the branches a user has selected?
[blue]SELECT Branch.*, Client.Name AS ClientName, Client.Name +' '+ Branch.Name AS FullName
FROM Client INNERJOIN Branch ON Client.ClientUID=Branch.ClientUID
WHERE Branch.UserRequired = 1
ORDERBY Client.Name, Branch.Name[/blue]
__________________
Any comments will be appreciated!
I have 4 tables, [blue]Branch, Client, User[/blue] and [blue]UserPreferredLocation.[/blue] Each client has multiple branches and a user has preferred branches they like to visit.
Currently, the query returns branches that require users and doesn't include branches that users like to visit. Is there any way I can modify the query to return all of the branches a user has selected?
[blue]SELECT Branch.*, Client.Name AS ClientName, Client.Name +' '+ Branch.Name AS FullName
FROM Client INNERJOIN Branch ON Client.ClientUID=Branch.ClientUID
WHERE Branch.UserRequired = 1
ORDERBY Client.Name, Branch.Name[/blue]
__________________