+ 1
How to range ID from 1 to 5 and 10 to 6 in one SQL statement
7 Antworten
+ 3
Answer to Is it possible to reverse ID (primary) in the database with auto increment so that it will always make the newest row's ID 1 automatically? by Mark Twaine https://www.quora.com/Is-it-possible-to-reverse-ID-primary-in-the-database-with-auto-increment-so-that-it-will-always-make-the-newest-rows-ID-1-automatically/answer/Mark-Twaine?ch=15&oid=42922425&share=3c4f9dce&srid=u79FBS&target_type=answer
+ 2
Maybe he wants a result like this
1, 2, 3, 4, 5, 10, 9, 8, 7, 6
I honestly don't know if it's possible without subqueries
+ 2
Rupali Thanks so much 🙏
+ 2
You're welcome :)
+ 1
SELECT columnName FROM tableName WHERE id >= 1 && id <= 5
SELECT columnName FROM tableName WHERE id <= 10 && id >= 6
+ 1
Yes Nick I need result as you said
+ 1
Im writing in SSMS