Re: percentages of top 10 tallies
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 10/06/04
- Next message: Tom Moreau: "Re: A trigger that prevents a duplicate value based on a foreign k"
- Previous message: Toby Herring: "Re: A trigger that prevents a duplicate value based on a foreign k"
- In reply to: Mortar: "Re: percentages of top 10 tallies"
- Next in thread: Mortar: "Re: percentages of top 10 tallies"
- Reply: Mortar: "Re: percentages of top 10 tallies"
- Messages sorted by: [ date ] [ thread ]
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)
- Next message: Tom Moreau: "Re: A trigger that prevents a duplicate value based on a foreign k"
- Previous message: Toby Herring: "Re: A trigger that prevents a duplicate value based on a foreign k"
- In reply to: Mortar: "Re: percentages of top 10 tallies"
- Next in thread: Mortar: "Re: percentages of top 10 tallies"
- Reply: Mortar: "Re: percentages of top 10 tallies"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|