Sample Header Ad - 728x90

Creating a table with Rank ordering in Oracle

0 votes
1 answer
139 views
I am trying to create a table in Oracle as follow: create table hops.t_distribution AS (select UID, CONTACT_EMAIL, PRODUCT_ID, rank() over(Partition by UID order by to_number(PRODUCT_ID)) as PRIORITY_ORDER from hops.staging_test); hops.staging_test is basically the same table without the PRIORITY_ORDER column. However, I am getting an ORA error because you can't order by in a create table statement. Is there another clever way to do this? Thank you!
Asked by JoD (1 rep)
Dec 10, 2020, 04:59 PM
Last activity: Dec 10, 2020, 09:27 PM