satishgaudo.com

Understanding technology

implementation of limit in queries

Example for implementation of limit in queries:SELECT temp.*,rownum FROM (

SELECT sp.company_name,
sp.contact_phone,
sp.office_fax,
sp.sub_id,
sb.branch_id,
sb.branch_url,
sp.Office_Address.Address1 || ', ' || sp.Office_Address.Address2 || ', ' || sp.Office_Address.Address3 || ', ' 
|| sp.Office_Address.City || ', ' || sp.Office_Address.County as address
FROM subscriber_primary sp,
subscriber_branch sb,
subscriber_info si
WHERE si.sub_id=sp.sub_id AND
sb.sub_id=sp.sub_id AND
si.sub_kind_id=4 AND
sp.primacy_no=1 AND
sb.branch_level = '0'
) temp
GROUP BY
temp.contact_phone,
temp.office_fax,
temp.sub_id,
temp.branch_id,
temp.branch_url,
temp.address,
rownum having rownum>=2 AND rownum<4
Bookmark and Share
Categories: Oracle