Implemetation of 'distinct' keyword with analytical function
630982May 5 2008 — edited May 5 2008Hi All,
i have some problem ----- implementing of 'DISTINCT' ketword with analytical questions.
i requesting you all, anybody help me out
c_9450 – Column name
qdb.asset_text_screen_long - table
this first query is giving me output of 6 rows--- what i want
1) SELECT DISTINCT c_9450
FROM qdb.asset_text_screen_long
WHERE upper(c_9450)
LIKE upper(CASE 7 WHEN 8 THEN '(UK)%' WHEN 5 THEN '(UK)' ELSE
c_9450 END)
AND catsearch(c_9450,'(\(UK\))'||'*',NULL)>0
this second query i am getting some wrong result,
i am unable to implement 'DISTINCT' keyword with analytical function like row_number().
please suggest me solution for this
2)SELECT *
FROM(SELECT row_number() OVER (ORDER BY c_9450) rec_num,
c_9450
FROM qdb.asset_text_screen_long
WHERE upper(c_9450)
LIKE upper(CASE 7 WHEN 8 THEN '(UK)%' WHEN 5 THEN '(UK)' ELSE c_9450 END)
AND catsearch(c_9450,'(\(UK\))'||'*',NULL)>0 )
WHERE rec_num BETWEEN 1 AND 10