SQL Benefits of JOINs?

Possible duplicate:
Is there something wrong with joins that don't use the JOIN keyword in SQL or MySQL?

Hi,

I always received data without connections ...

but is there any advantage of one method over another?

select * from a INNER JOIN b on a.a = b.b;

select a.*,b.*  from a,b where a.a = b.b;

Thank!

+3
source share
6 answers

These are both compounds. these are just two different syntactic representations for joins. The first (using the "Join" keyword is the current ANSI standard (as of 1992).

differeent , ANSI SQL92 , , . where, , . (, ).

, , , Join WRONG ResultSet.

.

0

INNER JOIN:

  • ANSI SQL

, - ​​ WHERE, , ( ).

JOIN WHERE, ..... INNER JOIN ( , ).

+8

, - . .

+2

JOIN. ( JOIN), , , .

+1

. , :)

0

, SQL- , . SQL .

You can also use EXPLAIN(SQL Server: Execution Plan Query ) to help you understand if there is a difference. Each request is unique, and I believe that stored statistics can (and will) change behavior.

0
source

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


All Articles