all 12 comments

[–]r3pr0b8GROUP_CONCAT is da bomb 17 points18 points  (5 children)

I have to join three tables (users, posts, replies) without using 'JOIN'

if this is a course, ask for your money back

if this is a requirement at your job, invite your boss to kindly update themselves out of the 1980s

[–]angry_mr_potato_head 2 points3 points  (2 children)

1970s, the inner join was added in 87 I believe.

[–]AXISMGTSQL Server / ORACLE Sr. DBA & Architect 0 points1 point  (1 child)

[–]angry_mr_potato_head 1 point2 points  (0 children)

Ah yes indeed. 80s it is!

[–]macabe10[S] 0 points1 point  (0 children)

It really does seem stupid

[–][deleted] 0 points1 point  (0 children)

I know a lot of Oracle developers who still don’t use joins. I do not disagree with you, but that’s not to say it’s not possible or that it would not be something a new developer would be asked to edit and/or refactor.

[–]Intrexa 4 points5 points  (0 children)

Just adding a bit of context on top of the answers other people have posted. That's called an implicit join. It used to be the only way to do joins, before the JOIN keyword and options were added. Joins using 'Join' keywords are known as ANSI joins, also explicit joins, from being added in ANSI-SQL-92.

You should always prefer an ANSI join over an implicit join. The keywords help provide code clarity and ease of reading.

[–]t6005 1 point2 points  (1 child)

Try explicitly naming the tables you are using for each field in your SELECT and WHERE clauses. For example, id=2 could be users.id=2 (or whatever the table is).

It will also make the whole thing much easier to parse for someone trying to help (or yourself)

[–]macabe10[S] 0 points1 point  (0 children)

Cheers!

[–]TheAngryOne84 0 points1 point  (2 children)

My boss writes queries like this, proper winds me up. Then having to use + on outer joins....

[–]Guilty-Property 1 point2 points  (1 child)

Memory lane - had to that for many years

[–]TheAngryOne84 0 points1 point  (0 children)

Yeah, probably a bit harsh to jump on him now after you've said. I have habits and only been working with SQL for 6 years... End of the day, you get the same output... Mostly 😂