Hi, can anyone tell me the advantages of alias name
It increases readability of the query result, and can shorten long queries.
Thanq.. but Other than that, is there any other advantages ??
alias name has several advantages.
* table_name AS table alias
* table_name table_alias.
2. This can also be useful on using self join.
I have a class that builds my html tables dynamically along with the table headers to show query results, I use an alias for some of the columns to change them to something different that I want to show in my html table. I assume we're talking about all types of aliases, so I thought I would through this in there too.
If same column name is found in a join query of two or more tables then you must use table alias.
There is a certain query that you can use to check a table for duplicate records. This requires doing a JOIN on a table with itself. As far as I know, the only way to do this is by creating two aliases for the same table.