Hi,

I have an SQL question. The following syntax is used in a MSDN example for 
retrieving a certain range of records from a table, so that data can be loaded 
into a DataGridView as a when is is needed for performance reasons:-

Select Top <n> * From PATIENTS WHERE PATIENT_PK NOT IN (SELECT TOP <n> 
PATIENT_PK From PATIENTS Order By PATIENT_PK) Order By PATIENT_PK

It would appear that the "TOP" syntax is not supported by SQLite (maybe just a 
Microsoft thing?).  However is there an alternative? i.e. How can I achieve 
what the example SQL syntax above is doing? Can I do this with SQLite at all?

Basically, when the above statement is run on access it takes 2-3 minutes on a 
database containing 10,000 records. We are now thinking of switching maybe to 
SQLite as we hope to get better storage efficiency and performance. However we 
will need to be able to execute a query similar to the one above.

Thanks in advance for any help.

Mark


DISCLAIMER:
This information and any attachments contained in this email message is 
intended only for the use of the individual or entity to which it is addressed 
and may contain information that is privileged, confidential, and exempt from 
disclosure under applicable law.  If the reader of this message is not the 
intended recipient, or the employee or agent responsible for delivering the 
message to the intended recipient, you are hereby notified that any 
dissemination, distribution, forwarding, or copying of this communication is 
strictly prohibited.  If you have received this communication in error, please 
notify the sender immediately by return email, and delete the original message 
immediately.

Reply via email to