What is the advantage or disadvantage of doing one of these methods?

I see some people joining in this way

SELECT * FROM table1
JOIN table 2
ON table1_id = table2_id

where, as some people do,

SELECT * 
FROM table1 
WHERE table1.table1_id = tabl2.table2_id;

what difference and what is more efficient and benificial

+3
source share
6 answers

That's why

SELECT * FROM table1
INNER JOIN table 2
ON table1_id = table2_id

SELECT * FROM table1
LEFT JOIN table 2
ON table1_id = table2_id

SELECT * FROM table1
RIGHT JOIN table 2
ON table1_id = table2_id

SELECT * FROM table1
FULL OUTER JOIN table 2
ON table1_id = table2_id
+1
source

, . , , . , , , , , , , . , SQL, , , , .

-, , , , , , , - .

, ?

+3

( ) . ( ) .

, , , SQL .

+2

€: : http://ibmsystemsmag.blogs.com/db2utor/2008/04/performance-com.html

, INNER JOIN IMPLICIT JOIN . , DB2 V4 V5, , , .

+1

( ) , , , ( ) . , , mysql - , SQL , .

: ; .

+1
source

No difference. These are the same queries. (The first request is similar to the "old school", because people who remember that the union expression is not present at all, and the second request is like the "new school", which cannot depict how to join, will work without unnecessary words :). This is a joke)

-5
source

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


All Articles