Oracle 11g - find out a new distinct value
问题 I've a table of users and one of the columns is User_ID ( naming policy = first letter of first name and rest is the last name. If a name is exists, then increment by 1). For example: John Doe -> user_id=jdoe If jdoe already exists then user_id = jdoe1 The input for the query is a basic user_id (e.g. jdoe) I would like to scan the table and for the output of the query to be : a new distinct value of user_id. If the table has the following values: jdoe jdoe1 jdoe2 jdoe3 The output should be