I for one would love to see SQLite support TOP as well as LIMIT (internally
it can just translate TOP to LIMIT).  It would greatly help in situations
where we want to support multiple database engines in an application.  

Shouldn't be a huge addition to the size of the engine either... :-)

Thanks,

Sam
 


-------------------------------------------
We're Hiring! Seeking a passionate developer to join our team building Flex
based products. Position is in the Washington D.C. metro area. If interested
contact [EMAIL PROTECTED]
 
-----Original Message-----
From: Igor Tandetnik [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 16, 2007 12:48 PM
To: SQLite
Subject: [sqlite] Re: SQL query - TOP <n>

Allan, Mark <Mark.Allan-g5UQV3DIpT5Wk0Htik3J/[EMAIL PROTECTED]> wrote:
> 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?).

SQLite supports LIMIT and OFFSET clauses. To select <n> rows starting 
from <m>th one (it appears that's what you are doing), do

SELECT PATIENT_PK From PATIENTS Order By PATIENT_PK LIMIT <n> OFFSET 
<m>;

Igor Tandetnik 


----------------------------------------------------------------------------
-
To unsubscribe, send email to [EMAIL PROTECTED]
----------------------------------------------------------------------------
-


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to