Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have the following data:
PRD-13
PRDF-4
ADQ-1
ASFS-77
AGXX-9
AMXX-14
AXX-17


I want to query the minimum that doesn't existe in following data, in this exemple it must be 2

I make one but it doesn't work

SQL
select MIN (substr(Code,charindex('_',Code)+1)+1) from produit where (substr(Code,charindex('_',Code)+1) + 1) not in (select (substr(Code,charindex('_',Code)+1)) from produit)
Posted
Updated 4-Mar-14 11:01am
v2
Comments
Maciej Los 4-Mar-14 17:00pm    
Hey! Do not remove your previous question, especially when there are comments and/or answers!
select MIN() SUBSTR() sqlite[^]
Maciej Los 4-Mar-14 17:02pm    
but it doesn't work is not informative at all!
nasrsoft 4-Mar-14 17:08pm    
I made a mistake, I wanted to make an update, I didn't do it on purpose, you have a solution for my problem?
Maciej Los 4-Mar-14 17:09pm    
No, because i don't know the exact problem.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900