[odb-users] How does one select the TOP N rows from a table using ODB?

Nicolas ALBEZA n.albeza at gmail.com
Wed Apr 11 06:33:31 EDT 2012


Then the only solution i know about is using Native Views:
http://www.codesynthesis.com/products/odb/doc/manual.xhtml#9.5.

But wait for Boris's answer, i never used ODB with a MS SQL DB, so i may
have missed something.

Le 11 avril 2012 11:35, PrinceToad <princetoad at 126.com> a écrit :

> This may works for MySQL
> but MS SQL Server doesn't support keyword LIMIT, which has only keyword
> TOP  and is just after the position of SELECT .
> such as:
> select TOP N * from footable
>
>
>
> At 2012-04-11 16:17:06,"Nicolas ALBEZA" <n.albeza at gmail.com> wrote:
>
> The only way i've found is along the lines of :
>
> result r = db.query<Foo>(FooQuery::bar == 42 + " ORDER BY baz LIMIT 10");
>
> But maybe Boris will be able to help you more =p
>
> Le 11 avril 2012 05:10, PrinceToad <princetoad at 126.com> a écrit :
>
>>  I'm using SQL Server, and I'd like to select top N rows from a certain
>> table.
>> How can I achieve this using ODB?
>>
>
>
>
> --
> ALBEZA "Pause" Nicolas
>
>
>
>


-- 
ALBEZA "Pause" Nicolas


More information about the odb-users mailing list