Skip to content
Advertisement

How to make RANK() or ROW_NUMBER() in ingres/vectorwise ? issue sql code

I am writing a sql query to get sales for different stores on a given day. The query is run against ingres/vectorwise. I want to add a column rank where there is the ranking of the store in regard of sales made in comparaison to all the stores.

My select statement is like follows:

I tried different things that I am familiar with from sql-server but none of it worked.

Advertisement

Answer

I think this is similar to what you’re describing (no day included here but you’ll get the idea):

See also the fine manual, here’s a link to the section on analytic functions: https://docs.actian.com/vector/5.1/index.html#page/SQLLang%2FAnalytical_Functions.htm

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement