Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
HI
I have Tabel with
this datas
1
2
3
7
8
9
11
12
can some one help me how to make query sql to give me backck
1
3
7
9
11
12
thnx for help
Posted
Comments
SASS_Shooter 30-Apr-12 16:19pm    
Reason for my vote of 1
Incomplete information provided and no indication of what has been tried so far.
nika2008 30-Apr-12 16:29pm    
hope u can help me now
nika2008 30-Apr-12 16:55pm    
i need i query how will give me the firs and last number in array
For example i have record with this datas

Number
1
2
3
4
7
8
9
13
14
15
and i need query how will give me this
1
4
7
9
13
15
SASS_Shooter 30-Apr-12 16:59pm    
Even there your verbiage of the problem does not match the pattern you're now displaying. I suggest you improve your question as follows:

I have data in a database with sequences of numbers. There are breaks in the contiguous stream of data. I need a query that returns the first and last number for each contiguous stream of values. For example
1,2,3,4,5,10,11,12,13 will return 1,5 10,13 etc.
ZurdoDev 30-Apr-12 16:21pm    
SELECT field FROM Table WHERE field NOT IN (2,8). However, since you did not give any detail this is a shot in the dark.

1 solution

SQL
select Column1, Column2... from Table
where not Column1 in (2,8)
 
Share this answer
 

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