Oh, there is one not-so-small problem: I would like the SQL statement to handle this:
"Category" = 3
"MinimumNo" = 4 should return 4
If the only record in the table MyUnit
-UnitNo = 12
-CategoryNo = 3
Maybe I can check Table MyUnit for a record with UnitNo that equals @MinimumNo-1, and if...
This is a bit of an SQL nut (at least to me).
I want to find the SQL statement that gets the next unused number within that category.
Simplified Table:
Table name: MyUnit.
Attributes:
-UnitNo
-CategoryNo
Let's assume the statement
SELECT UnitNo FROM MyUnit WHERE (CategoryNo=@Category)...
Hi, I want to find the SQL statement that gets the next unused number within that category.
Simplified Table:
Table name: MyUnit.
Attributes:
-UnitNo
-CategoryNo
Let's assume the statement
SELECT UnitNo FROM MyUnit WHERE (CategoryNo=@Category)
returns the set {1,2,3,4,5,7,8,10,11,12} if...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.