Skip to content
Advertisement

What does back to back table references mean in SQL from clause

I am looking at a query from crystal reports and it shows a table name immediately followed by a table name. see below if that didn’t make sense but I am trying to understand what this syntax is/does? thank you in advance for any insight

select * from {oj ((table_name table_name inner join ......))}

Advertisement

Answer

The 2nd name is the alias. It allows you to refer to the table using a different name. For example, you may want to shorten the references to that table throughout the rest of the statement in order to make things more readable. Or, more importantly, you may want to use the same table twice in the same statement (in which case an alias is required).

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement