Tuesday, December 18, 2018

ROWNUM as a Filter in ODBC Queries

Oracle has some issues with the rownum. ROWNUM is like a row counter that increments for each row returned by the query, before any sort. To apply it on a query with ORDER BY, it needs one more level of subquery

Example:
select * from (
SELECT rownum arn, member_id, member_email
FROM contacts
WHERE member_email_domain = 'slb.com'
AND communities_member = 'T')
where arn between 10 and 20

No comments:

Post a Comment