From MSSQL to Teradata SQL newbie question

Database
Fan

From MSSQL to Teradata SQL newbie question

Hi. I have experience in Mssql and new to teradata sql. They say its almost the same. Id like to create the teradata sql code more readable. 

 

In MSSQL we can give alias name of the column before it. Example:

 

SELECT

[FullName] = e.name

FROM dbo.employee e

 

In Teradata SQL:

 

SELECT

e.name as FullName

FROM dbo.employee e

 

Is there a way that i can put the alias column name in front so i't'll be readable? Thanks!

 

 

5 REPLIES
Teradata Employee

Re: From MSSQL to Teradata SQL newbie question

Teradata implements the ANSI SQL syntax. This non-standard syntax alternative is not offered.

 

Try it this way for a few queries and it will look like the more readable version:-)

Fan

Re: From MSSQL to Teradata SQL newbie question

Thanks! Can you give a sample on how the code would look lke? or is it the same as what i put above?

Tags (1)
Highlighted
Teradata Employee

Re: From MSSQL to Teradata SQL newbie question

Your example is correct. And the AS clause can be placed on any expression as well as a column to give that expression a name.

Senior Apprentice

Re: From MSSQL to Teradata SQL newbie question

As Todd already wrote, this is proprietary syntax.

SQL Server also supports the Standard SQL syntax for a long time, of course Microsoft doesn't tell users what's Standard :-)

 

If you need special characters (other than 0-9,a-z,#,_,$ in Teradata) or you need a keyword as a column name you must apply double quotes, e.g. [my special ööö] -> "my special ööö"

 In Standard SQL double quoted names would be case sensitive, but not in Teradata (and that is a good thing).

 

Enthusiast

Re: From MSSQL to Teradata SQL newbie question

Although from 2012 I hope that this helps you a bit:

http://sqlfool.com/mssql-dba-guide-to-teradata/