2012年3月7日星期三

First() and last() function -> course says yes, Book on line

Hi,
I guess that's what they meant by each flavour of SQL can have slightly
different syntax and to check with the manuals.
Thanks for confirming it.
Richard
Tenaya wrote:
> Richard,
>
>
> Apparently so :-)
> Chief Tenaya
Hi Greg,
This sounds like it should work. I checked Book Online but can't find
any mention of the top modifier ... aside from inside the complicated
full explaination of the SELECT statement. Is this what you meant?
I never realized who powerful (and complicated) the SELECT statement is
Thanks for your help
Richard
From Books Online's select (described)
...
< query specification > ::=
SELECT [ ALL | DISTINCT ]
[ { TOP integer | TOP integer PERCENT } [ WITH TIES ] ]
< select_list >
[ INTO new_table ]
[ FROM { < table_source > } [ ,...n ] ]
[ WHERE < search_condition > ]
[ GROUP BY [ ALL ] group_by_expression [ ,...n ]
[ WITH { CUBE | ROLLUP } ]
]
[ HAVING < search_condition > ]
Greg Low (MVP) wrote:

> You need the TOP modifier. eg.
> SELECT TOP 1 Age AS lowest_age
> FROM Persons
> ORDER BY Age
> HTH,

没有评论:

发表评论