I was wondering if anyone had run into the following situation:
I have rows that look like this:
table_id | foreign_key1 | foreign_key2
The foreign_key2 is the unique value. What I would like to do is have a sequential count of where table_id and foreign_key1 are the same.
1 | 1 | 2
1 | 1 | 3
So for the above I would get something like:
In Oracle I could call the ROW_NUMBER() function. Is there anything similar to that in MySQL? My searches have only brought back stored procedures that won't work for my situation.
1 | 1 | 2 | 1
1 | 1 | 3 | 2