I have table with columns like AutoID, Number, Name, City, State, Country.
What I wanted is the maximum number entered in the “Number” column with the combination of Name, City, State and Country.
Name City State Country ----- ---- ----- ------- Smith NY NY USA John NY NY USA John NJ NY USA
Now smith should get “Number” 1, John 2, and again John(in NJ) 1 as he is the first from NJ.
I can simply put a where clause in query and get the max number + 1. But the problem is that when I have huge amount of data and the number of users increases, my query will be really slow. I am also inserting data in the same table so it will keep on piling.
I hope I have made my self clear.