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
Post a Comment