Is it possible to create auto-increment based on a specific field? For example i have UserId and Status fields, so for each row with same UserId i need to auto-increment its Status, not global.
Is it possible to create auto-increment based on a specific field? For example i
Share
There is three thing that come to mind when I read your question. One was an auto incrementing field which acts as your ID number. Updating a table with data that has no unique ID number. Searching for fields with the same
UseridtoStatusMt First example is of a creating a table and your
AUTO_INCREMENTing number ID:More on auto incrementation.
You may have already built your table and now want to ‘add’ additional and or modify your fields using
ALTER:But be careful, you don’t want to overwrite your settings that you have already set.
Another Thing that came to my mind when reading was where you said Status and Userid where the same. You can find these using the
WHEREclause like so:Using these queries you can update, remake, alter and query your database table.