Skip to content
Advertisement

Oracle SQL – Assign number to distinct tech_spec

In Oracle SQL, I’m trying to assign a unique number to each distinct tech_spec.

Output:

I’m trying to get assign each distinct tech_spec a number. I have been searching for a way to do this but can’t come up with anything.

Output desired:

Thanks in advance.

Advertisement

Answer

Use dense_rank():

You should also learn to use proper, explicit JOIN syntax.

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