0

I am new in sql so i just dont know the difference between them. Does it affect compile time or something else? Can you explain it?

select a.name, b.salary from account a, bank b
where a.id = b.id;

or

select a.name, b.salary from account a
join bank b on a.id = b.id;
1
  • 3
    Tip of today: Always use modern, explicit JOIN syntax. Easier to write (without errors), easier to read and maintain, and easier to convert to outer join if needed
    – jarlh
    Nov 22, 2021 at 7:31

1 Answer 1

1

There is no difference. The latter is a newer (SQL-92) syntax and easier to read.

2
  • ok, and can we write two join repeatedly? join b on blabla nextline join c on blabla
    – mert
    Nov 22, 2021 at 7:08
  • Yes, you can add multiple joins, to both the "base" table and a previously joined table Nov 22, 2021 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.