0

hi,

i need to do a query which joins multiple tables but i need to join the same 2 tables multiple times.

is that possible?

SELECT timeline.TimelineID, timeline.SIPPorCASH, timeline.clients_ClientID, timeline.UserID, timeline.IFAID, timeline.RegionalSalesManager, timeline.AreaSalesManager, timeline.AgencyTradingAgreementSigned, timeline.DateOfClientMeeting, timeline.EstimatedPensionFundAmount, timeline.DateAuthorityMandateSentToIFA, timeline.DetailsOfPensionFunds, timeline.ProductID, timeline.PropertyRef, timeline.NPW, timeline.CaseComplete, clients.ClientID, clients.App1FirstName, clients.App1LastName, clients.App2FirstName, clients.App2LastName, users.UserID, users.FullName
FROM timeline JOIN clients on timeline.clients_ClientID = clients.ClientID join users on timeline.UserID = users.UserID
WHERE timeline.NPW = 0 and timeline.CaseComplete is null and timeline.clients_ClientID = ParamClientID

i need to join timeline.UserID, timeline.IFAID, timeline.RegionalSalesManager, timeline.AreaSalesManager all to users.UserID?

hope someone can help.

many thanks

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by smantscheff
0

thanks for that, so do you mean:

SELECT users.UserID as Agents, users.UserID as IFA

Would that allow me to join the same tables multiple times?

thanks

0

No, that way you have an alias for the column names, not for the tables.
It must go along the line

SELECT Agents.UserID, IFA.UserID FROM Users As Agents, Users As IFA where ...
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.