Limiting # of Rows in SQLCE Select

J

Jim Wilson [eMVP]

This is a pretty low-tech solution but you could split your second example
into two parts.
 
P

Pete

Ok, it appears the Top keyword doesn't work in SQLCE, nor does subselect
statements in the where clause. Is it possible to limit the number of
records returned by the query?

Two examples that don't work:

select top 1 * from setup order by createdate desc;
select * from setup where createdate = (select max(createdate) from setup);

Thanks,
 
P

Peter Foot [MVP]

If you are using an SqlCeDataReader to read the data you can keep count of
the rows you have read and close the reader once you have enough.

Peter

--
Peter Foot
Windows Embedded MVP

In The Hand
http://www.inthehand.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top