May 30, 2005 at 9:46 am
Hello,
MSSQL 2000/sp3
A developer stumbled across the DERIVEDTBL keyword while coding. There seems to be little documentation on this keyword and its use. Is it ANSI, or proprietary to MSSQL? Is it an undocumented function?
ie:
select * from
(
select * from zzA
union
select * from zzB
) DERIVEDTBL ORDER BY len(a_name)
Many thanks. Jeff
May 30, 2005 at 9:49 am
It's the alias name for the derived table.
(
select * from zzA
union
select * from zzB
)
becomes a virtual table in the select that can be used like any real table.
DERIVEDTBL just happens to be his name.. which can be changed to anything you like.
May 30, 2005 at 12:56 pm
Has your developer experienced any issues with this word?
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
May 30, 2005 at 1:59 pm
That could actually make for a pretty good quiz question, at least if trick questions are accepted.
May 30, 2005 at 2:04 pm
Not sure many would fall for that one...
How many coders do you expect ignore that the table can be aliased?
We could always sugget it to Steve.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply