Re: Just another SQL Query
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Tue, 20 Mar 2007 20:41:05 -0400
John wrote:
Hello again,Two inner joins should work. Perhaps you should clarify "doesn't work".
I have an other SQL Query Problem. I have a table 'Visit' with the
columns 'Reason', 'PersonA' and 'PersonB'. These columns are Guids.
Then I have an other table 'Persons' with a column 'ID' (Guid),
'Name' and 'Date of birth'. Now I need a Query that gives me this
result: Visit.Reason and the name of PersonA and PersonB.
I tried it with two 'inner join' but that doesn´t work...
select v.Reason,v.PersonA,a.[Name] as NameOfA,
v.PersonB, b.[Name] as NameOfB
FROM Visit v inner join Persons a on v.PersonA=a.ID
inner join Persons b on v.PersonB = b.ID
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- Prev by Date: Re: ADO high virtual memory usage
- Next by Date: Re: ADO high virtual memory usage
- Previous by thread: Re: SQL Query Problem
- Next by thread: Re: Defect ADO library VBScript??
- Index(es):