Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

Alias names - SQL Server Vs Oracle

Apr 5 2011 2:23AM by Madhivanan   

Alias name can be used in such cases like more than a table is used in the select statement, naming a derived column or table, etc. However the usage seems to be different among the RDBMSs. Consider the following examples which are valid in SQL Server

select t.* from table1 as t

select sum(t.amt) as amt from
(
select amt from table1
union all
select amt from table2
) as t

In the above examples the alias name is preceded by the keyword as. But when you use ORACLE alias names cannot be preceded by as for table names (although it is valid for column names). So in ORACLE the above code should be as follows

select t.* from table1 t

select sum(t.amt) as amt from
(
select amt from table1
union all
select amt from table2
) t

But note that SQL Server supports with/without the keyword as. It is helpful to know the syntax difference of different RDBMSs

Tags: t-sql, sql_server, alias_name, sqlserver, tsql, BRH, #TSQL, #SQLServer,


Madhivanan
3 · 39% · 12440
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

2  Comments  

  • I wonder if the with/without "as" support that SQL Server provides was a conscious design decision on the part of Microsoft for easy portability from Oracle to SQL Server....just a thought. Thanks for the post, Madhivanan!

    commented on Apr 10 2011 12:23PM
    Nakul Vachhrajani
    4 · 33% · 10587
  • Hi Nakul

    The SQL Server syntax in very flexible. Yes it mifght be a decision to keep that to work when queries are migrated from other RDBMSs

    commented on Apr 11 2011 4:14AM
    Madhivanan
    3 · 39% · 12440

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]