python - how to limit records set in SQL WHERE clause -


i've got software can provide sql queries db. there limitation, can change where clause... ex.: [python] x = gp.searchcursor('database_name','fields want view','where_clause')

i've got table ~250k records , want first 50-70 (number doesnt matter) of records. question how can create query (actually clause) return mi records?

just clarify, on bottom of application there oracle , ms sql server (depends of called database)

maybe can trick using subquery in where

where yourid in (select top 50 yourid yourtable youractualconditions) 

this work sql server, oracle syntax different:

where yourid in (select yourid yourtable youractualconditions , rownum<=50) 

edit in oracle wouldn't need subquery:

 youractualconditions , rownum<=50 

should enough


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

c++ - End of file on pipe magic during open -