sql-machine-learning / sqlflow

Brings SQL and AI together.
https://sqlflow.org
Apache License 2.0
5.09k stars 699 forks source link

Wrong statements about SQL joining syntax #345

Closed wangkuiyi closed 5 years ago

wangkuiyi commented 5 years ago

Describe the bug

In our document, we state

For example, various engines use different syntax for joining.

MySQL: SELECT pet.name, comment FROM pet, event WHERE pet.name =event.name; with > keyword WHERE . Hive: SELECT pet.name, comment FROM pet JOIN event ON (pet.name =event.name) with keyword JOIN and ON. ODPS and SQLite use either INNER JOIN or OUTER JOIN.

However, MySQL supports the INNER JOIN .. ON .. syntax too, as documented here.

Additional context

Zhiheng Zhou reported this bug from Alibaba Group. I am the one who wrote it down.

tonyyang-svail commented 5 years ago

Thank Zhiheng for pointing out the mistake. I will update the document using the FULL OUTER JOIN example: https://stackoverflow.com/questions/4796872/how-to-do-a-full-outer-join-in-mysql .

The goal of this section is to point out there are some syntax differences across different SQL engines.