Re: SELECT ~~ OVER(PARTITION BY ~~) in SQL Server 2005?
- From: "David Portas" <REMOVE_BEFORE_REPLYING_dportas@xxxxxxx>
- Date: Sat, 25 Feb 2006 10:24:36 -0000
"Ed White" <ewhite@xxxxxxxxxxxxxxxxx> wrote in message
news:5AD5BA1A-688F-43F5-A08D-D02F94D5A2B0@xxxxxxxxxxxxxxxx
I'm using VS 2005 with SQL Server 2005 (all are release versions). I read
about the new Windows Functions SQL commands in a book, and, using the
Query
Designer, created a SQL Query against my database that included
SELECT COUNT(field1) OVER (partition BY field1) AS Num
First, I type the query into the SQL pane. Then, when I click on another
pane, a message pops up "SQL Syntax Error Encountered...The OVER SQL
construct or statement is not supported." I hit OK, but when I click on
"Verify SQL Syntax", it responds "The SQL syntax has been verified against
the data source.", and when I Execute the query, it works and comes up
with
results that would be expected if the OVER command works. So, does SQL
Server 2005 support the OVER command or not? If so, then the error
statement
that pops up when I type it in is a bug.
--
Ed
Your syntax is correct but not all features can be supported by the
graphical Query Designer (same was true in 2000). That's just another good
reason not to use the Designer. Select File / New / Query and type your
queries in the editing window instead.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
.
- Prev by Date: Re: question on date (or string after using convert function) comparis
- Next by Date: Re: Eliminating Duplicated
- Previous by thread: Re: question on date (or string after using convert function) comparis
- Next by thread: Re: SELECT ~~ OVER(PARTITION BY ~~) in SQL Server 2005?
- Index(es):
Relevant Pages
|
|