When I test this request:
SELECT
*, ROW_NUMBER() OVER (ORDER BY test1) AS lineNumb
FROM
(SELECT DISTINCT
tab1.test1, tab2.test2
FROM TB_tab1 tab1
JOIN TB_tab2 tab2 ON tab2.test3 = tab1.test3
JOIN TB_tab3 tab3 ON tab3.test4 = tab1.test4
WHERE tab3.test5 != 'test') AS sub
WHERE lineNumb BETWEEN 1 AND 5
I get:
Error: column name invalid : 'lineNumb'. SQLState: S0001 ErrorCode: 207
Why and how can I correct my request?