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.



2 comments:

  1. 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?

    Thanks.

    ReplyDelete
  2. Hi Andy, please see my comments to the article by Christ tacke here: http://community.opennetcf.com/articles/cf/archive/2007/09/21/improving-data-access-performance-with-data-caching.aspx
    - the sample could be considered a demo of TOP 1 with SQL Compact 3.1

    ReplyDelete