Re: percentages of top 10 tallies

From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 10/06/04


Date: Wed, 06 Oct 2004 20:48:12 +0200

On Wed, 06 Oct 2004 15:51:16 GMT, Mortar wrote:

>thanks for the help guys.
>a quick question: what is the capital T for in Hugo's query? It seems
>I can change it to anything and it still works, but if I remove it, it
>doesn't.

Hi Mortar,

If you use tables (or views) in the FROM clause, the syntax is:

        FROM { tablename | viewname } [ [AS] table_alias ]

You don't have to provide an alias (in which case you can reference
columns from a table (or view) by prefixing the column name with the
tablename (or viewname). If you do provide an alias, you'll have to prefix
columns with the alias instead of the tablename (or viewname).

If you use a derived table, you use the following syntax:

        FROM (subquery) [ AS ] table_alias [ ( column_alias [, ...n ] ) ]

In this case, the table_alias is mandatory. This makes sense, as there
must be a way te reference columns in the result set of the subquery; it
has no name of it's own, so you have to supply it - even if all references
to columns from the derived table are done with column name only. Required
by the syntax.

For clarity and readability, I usually don't omit the optional keyword AS
and I try to choose a descriptive mnemonic as table alias. In this case, I
copied and adapted Steve's code and didn't change the alias.

Best, Hugo

-- 
(Remove _NO_ and _SPAM_ to get my e-mail address)


Relevant Pages

  • Re: percentages of top 10 tallies
    ... ok thanks for clearing that up and provinding me with a reference. ... >If you use tables in the FROM clause, the syntax is: ... If you do provide an alias, ... >columns with the alias instead of the tablename (or viewname). ...
    (microsoft.public.sqlserver.programming)
  • Re: true-random number generator (TRNG) info.
    ... was putting forth a crackpot idea? ... I guess his reference to poker wasn't much ... Uhhhh....you didn't say anything at all about his creating an alias ... You have a warped understanding of the word "logic". ...
    (rec.gambling.poker)
  • Re: Access doesnt like its own SQL
    ... I guess Access' thing is like the 'AS DerivedTable' syntax ... replace the opening bracket and closing ... your own alias name. ... FROM [SELECT KitItem ...
    (microsoft.public.access.modulesdaovba)
  • Re: OSRegSetValueEx versus RegSetValueEx
    ... I went through code and almost each function has some Alias attached to it. ... >> I cannot find any reference to it on MSDN site, ... > It's an excellent registry class that I use whenever I need registry ...
    (microsoft.public.vb.general.discussion)
  • Re: on merging datasets and datatables
    ... Your code doesn't work because you are simply creating another reference to ... an existing DataTable object; you are not actually creating a new data ... Please do not send e-mail directly to this alias. ... > into a single dataset, so as to have a single dataset with the ...
    (microsoft.public.dotnet.languages.csharp)