Sunday, August 26, 2007

TOP clause now supported

So now in SQL Compact 3.5 you can make queries against Northwind.sdf with the following syntax:

SELECT Top(10) *

FROM [Order Details]
ORDER BY [Unit Price] * Quantity DESC

And you will get the 10 most valuable orders listed.

It's nice to see this omission finally added to the SQL Compact syntax.


Unknown said...

Thanks a lot for your reply about supporting x64-bit.

I read some posts on SSCE msdn forum.

if I only want to one row on SSCE3.1,
like Select top(1) * from [...].

how could I implement it?


ErikEJ said...

Hi Andy, please see my comments to the article by Christ tacke here:
- the sample could be considered a demo of TOP 1 with SQL Compact 3.1