SQL Server Query view for equi federation

Are these queries equi join views?

I believe that both return the same result.

Query1:

SELECT C.* FROM [Case] A, [Event] B, Notice C
WHERE A.CaseID = B.CaseID
AND B.EventID = C.EventID

Query2:

SELECT C.* FROM [Case] A
join [Event] B on A.CaseID = B.CaseID
join Notice C on B.EventID = C.EventID

Please clarify.

+3
source share
2 answers

Yes, the same queries, different syntax.

The second request is better written as:

SELECT C.* 
FROM [Case] A 
inner join [Event] B on A.CaseID = B.CaseID 
inner join Notice C on B.EventID = C.EventID

The second query using ANSI syntax has several advantages over the first:

  • easy to see when you have no offer ON
  • makes it clear which connection is in progress.
  • shares a sentence JOINfrom a sentenceWHERE
+4
source

FROM JOIN. INNER JOIN OUTER JOIN, .

0

Source: https://habr.com/ru/post/1731241/


All Articles