Get the App
SLTechnology News&Howtos  ›  Database  › 

Two-step implementation of mysql to generate non-repeating id sequentially

Shulou Source: shulou.com Published: 2022-06-01 18:32:21 10月03日 Update

This article mainly introduces you two steps to achieve mysql in order to generate non-repetitive id, the content of the article is carefully selected and edited by the author, with a certain pertinence, and is of great significance to everyone's reference, the following is to understand with the author that the next two steps are to achieve mysql in order to generate non-repetitive id.

Non-letter and non-zero start generate a non-repeating idselect case when max (id) is null then '10000001' else max (id) + 1 end as id from student; letter start to generate a non-repeating id sequentially

Select case when max (id) is null then 'S10000001' else CONCAT (' max (id), 2) end as id from student

After reading the above about the two-step implementation of mysql in order to generate non-repetitive id, many readers must have some understanding. If you need to get more industry knowledge and information, you can continue to follow our industry information column.

Tags: Order generation letter beginning author industry information content meaning articles more friends columns knowledge readers information or pertinence reference affirmation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MariaDB MySQL Xiaomi Docker