-1

I was given a query to a database that I'm unfamiliar with and am having trouble figuring out the syntax. I've never seen a table listed like this, so I'd like an explanation of what this is doing:

select *
from source_table as source
inner join other_table as other
    on (source.field1 = other.field2),
third_table as third
where source.id = 5
and third.description = 'Overload'

How is table third being included here? I don't see a join clause for it or a statement for it after where.

I've tried setting up a similar query on a database that I'm familiar with, but haven't been able to write a query like this. The query above works, as I've been able to run it, but I'm stumped as to how it works. Any explanation would be appreciated

simplycoding
  • 2,770
  • 9
  • 46
  • 91
  • The key is the `,` (comma) following the join to `other_table`. This is the pre-1992 join syntax. That is, its **30 years old** and should be avoided. If you see this, be suspicious of the quality of the code. – Joel Coehoorn Apr 14 '23 at 17:10

1 Answers1

-1

Figured it out, looks like this is just doing a cross join

simplycoding
  • 2,770
  • 9
  • 46
  • 91