Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report