I'm trying to join two columns along with pagination. I am able to achieve this without pagination using below query:
SELECT (column1 || ', '|| column2) des, (column3|| ''|| column4) id
FROM table
WHERE column1 IS NOT NULL
GROUP BY column1, column2, column3, column4
ORDER BY column1 ASC
For adding pagination to above query I have used below query but it is not working:
SELECT (column1 || ', '|| column2) des, (column3 || ''|| column4) id FROM (
SELECT rownum rnum, a.*
FROM (
SELECT (column1 || ', '|| column2) des, (column3|| ''|| column4) id
FROM table
WHERE column1 IS NOT NULL
GROUP BY column1, column2, column3, column4
ORDER BY column1 ASC) a
WHERE rownum < ((1 * 100) + 1)
)
WHERE rnum >= ((1 - 1) * 100) + 1
I am running these queries on oracle database. Can anyone help me to achieve this or if there is any syntax error in the above query.