I am relative newcomer to SQL, but have gained many useful ideas through the site. Now I'm stuck on a piece of code that seems simple enough, but for some reason I can't wrap my head around it.

I am trying to create a third column (Column Z) based off of the first two columns below:

```
Column X   Column Y
-------------------
 1          a
 1          b
 1          c
 2          a
 2          d
 2          e
 2          f
 4          b
 5          i
 5          c
 3          g
 3          h
 6          j
 6          k
 6          l

```

What i need to have happen in Column Z:

> 
> * For each individual value found in Column Y, note the value of Column X
> * Likewise, for each individual value in Column X, note the value of Column Y
> * Then, cluster (RANK/ROW\_NUMBER?) these into groups seen below:
> 
> 
> 

```
Column X   Column Y  Column Z
-----------------------------
 1          a         1
 1          b         1
 1          c         1
 2          a         1
 2          d         1
 2          e         1
 2          f         1
 4          b         1
 5          i         1
 5          c         1
 3          g         2
 3          h         2
 6          j         3
 6          k         3
 6          l         3

```

I hope I've been clear enough without over-complicating things. My head has been spinning all morning. Let me know if anyone needs any more info.

Greatly appreciated in advance!