Get the App
SLTechnology News&Howtos  ›  Database  › 

How to use Sql statement to find the minimum available id

Shulou Source: shulou.com Published: 2022-05-31 18:14:02 10月03日 Update

This article mainly introduces "how to use the Sql sentence to find the minimum available id". In the daily operation, I believe that many people have doubts about how to use the Sql sentence to find the minimum available id. The editor consulted all kinds of materials and sorted out a simple and easy-to-use operation method. I hope it will be helpful for everyone to answer the doubt of "how to use the Sql sentence to find the minimum available id". Next, please follow the editor to study!

Select id from test a where not exists (select 1 from test where id=a.id+1) order by id

Disadvantages, do not start from 1.

At this point, the study on "how to use Sql sentences to find the minimum available id" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Minimum sentence learning more help practical next articles methods theories knowledge articles shortcomings websites materials follow questions easy to use practice solutions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MariaDB Redmi NVidia Docker