What's going on with the median function in Teradata?

Database
Enthusiast

What's going on with the median function in Teradata?

If I type median in a Teradata query, the word becomes blue, but it does not become bold and blue.

So, I suspect what's going on is that median is not, in fact, a function in Teradata, but the word is reserved and cannot, for example, be assigned to a user written function. Is this correct?

Second, if median is not a function, what's up wih this page? - http://www.info.teradata.com/HTMLPubs/DB_TTU_15_00/index.html#page/SQL_Reference/B035_1145_015K/Orde...

Thanks!

-Dylan

Tags (4)
4 REPLIES
Teradata Employee

Re: What's going on with the median function in Teradata?

MEDIAN function was introduced in TD15.0 but it was a reserved word long before that. Highlighting also depends on the version of the client tool in use (SQL Assistant or Studio).

Senior Apprentice

Re: What's going on with the median function in Teradata?

@Fred:

MEDIAN is available in TD14.10 already :-)

@Dylan:

The easiest way to find out if it's a reserved keyword is to see if it fails as a column name:

select 1 as median;

median
------
1

Or use the built-in view:

SELECT *
FROM SYSLIB.SQLRestrictedWords
WHERE restricted_word = 'MEDIAN';

restricted_word category ANSI_restricted
------------------------------ -------- ---------------
MEDIAN N T

So MEDIAN is a keyword, but not restricted. IMHO blue, but not bold, is correct :-)

Enthusiast

Re: What's going on with the median function in Teradata?

Thanks Fred and Dieter!

Dieter - What determines whether a word is blue vs. bold and blue?

Senior Apprentice

Re: What's going on with the median function in Teradata?

There's a language file which determines the parsing & highlighting rules:

C:\Program Files (x86)\Teradata\Client\15.00\Teradata SQL Assistant\teradata.lng