ROW_NUMBER() with Qualify clause
Posted: Thu May 30, 2013 3:30 pm
Hello All,
In TD the the select clause uses a ROW_NUMBER function differently from Vertica
The ROW_NUMBER function assigns a unique number to the rows starting from 1 with thewindows partition clause
The TD way to write this function
Can we write it this way in Vertica, I tried it but the qualify keyword is not taken by Vertica and the from Clause has to be at the end.
Can anybody explain what the above query does and how can we achieve the same in Vertica.
In TD the the select clause uses a ROW_NUMBER function differently from Vertica
The ROW_NUMBER function assigns a unique number to the rows starting from 1 with thewindows partition clause
The TD way to write this function
Code: Select all
sel a.pm_id, a.pm_name
from loc_table a qualify row_number() over(partition by pm_id
order by pm_name asc) =1
Can anybody explain what the above query does and how can we achieve the same in Vertica.