select
HIER_LEVEL,
STANDARD_SOURCE,
TITLE,
YEAR_ADOPTED,
row_number() over(partition by TITLE,
YEAR_ADOPTED
order by title,year_adopted) group_id
from table
Thanks Hrishy for your response. That is one of the few things I tried, but you are asking to group by Title and year_adopted, so the output looks like this :
Code:
HIER_LEVEL STANDARD_SOURCE TITLE YEAR_ADOPTED GROUP_ID
1 FL Sunshine State Standards 2006 1
1 FL Sunshine State Standards 2007 2
1 GA Performance Standards 2004 1
1 GA Performance Standards 2004 1
This is the closest I could get to, but it is still not correct :
row_number() over(partition by hier_level
order by standard_source, title,year_adopted)
Code:
HIER_LEVEL STANDARD_SOURCE TITLE YEAR_ADOPTED GROUP_ID
1 FL Sunshine State Standards 2006 1
1 FL Sunshine State Standards 2007 2
1 GA Performance Standards 2004 3
1 GA Performance Standards 2004 4
Bookmarks