Alias table imporve performance or? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Alias table imporve performance or?

Hi, Lets say I’ve a sql statement called select emp.fname, emp.lname, emp.dob from employee emp. I would like to know the alias will increase the performance or no difference. Thanks,
Prabakar
No difference in the performance and the readability of a SELECT statement can be improved by giving a table an alias, also known as a correlation name or range variable. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
No difference, but sometimes required.
———————–
–Frank
http://www.insidesql.de
———————–

No difference, but you cannot use alias in every clause of a query. For example this query will not compile:
SELECT MAX(table1_id) AS max_table1_id
FROM table1_id
GROUP BY column1
WHERE max_table1_id > 10
— Marek Grzenkowicz

Your example won’t compile at all. No matter whether you use an alias or not. [<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ />]<br />This is the syntax for SELECT…<br /><pre><br />SELECT select_list <br />[ INTO new_table ] <br />FROM table_source <br />[ <b>WHERE</b> search_condition ] <br />[ <b>GROUP BY</b> group_by_expression ] <br />[ HAVING search_condition ] <br />[ ORDER BY order_expression [ ASC | DESC ] ] <br /></pre><br /><br />———————–<br />–Frank<br /<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br />———————–<br />
<blockquote id="quote"><font id="quote" size="1" face="Verdana, Arial, Helvetica">quote:<hr height="1" id="quote" noshade="noshade"><i>Originally posted by FrankKalis</i><br><br>Your example won’t compile at all. No matter whether you use an alias or not. [<img src="http://sql-server-performance.com/community/emoticons/emotion-5.gif" alt=";)">]<hr height="1" id="quote" noshade="noshade"></font></blockquote>You’re right.<br><br>I meant something like this:<br><pre>SELECT MAX(table1_id) AS max_table1_id<br>FROM table1<br>GROUP BY column1<br>HAVING max_table1_id &gt; 10</pre>–<br><br>Marek Grzenkowicz<i><br></i>
]]>