Combine two sql select queries (in postgres) with LIMIT statement Combine two sql select queries (in postgres) with LIMIT statement postgresql postgresql

Combine two sql select queries (in postgres) with LIMIT statement


Just checked that this will work:

(SELECT * FROM catalog_productimageORDER BY date_modifiedLIMIT 10)UNIONSELECT * FROM catalog_productimageWHERE id=5;


This will give you records from 10th to 20th and should get you started.i will reply back with SQLfiddle

SELECT *    FROM (SELECT ROW_NUMBER () OVER (ORDER BY cat_id) cat_row_no, a.* FROM catalog_productimage a where x=5)   WHERE cat_row_no > 10 and cat_row_no <20