Click here to Skip to main content
12,303,940 members (74,154 online)
Click here to Skip to main content

Tagged as

Stats

0 views
Posted

How to find a gap in the table between min and max value using pure SQL

, 14 Nov 2012 CPOL
While Shanalal Kasims solution is cool, it doesn't work when you have a larger gap in the sequence.This is pure SQL and should work for all cases:WITH M AS ( SELECT Max(SEQUENCE) s FROM table1 WHERE id = 1 ),numbers(n) AS ( SELECT 1 AS n UNION ALL...

Revisions


  

Compare Revision Minor Date Status Editor
5 - publicly available No 14-Nov-12 7:25 Available Jörgen Andersson
Updates in content. 8 changes had been made.
3 No 14-Nov-12 7:12 Available Jörgen Andersson
Updates in content. 93 changes had been made.
2 No 14-Nov-12 6:04 Available Jörgen Andersson
Forgot Parenthesis
1 No 14-Nov-12 4:35 Available Jörgen Andersson

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Jörgen Andersson
Database Developer
Sweden Sweden
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160530.1 | Last Updated 14 Nov 2012
Article Copyright 2012 by Jörgen Andersson
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid