Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> SQL Question
please help
I have a table test with one column val.
Test
1
3
4
5
9
10
13
I need a query with the below output
Output:
2
6
7
8
11
12
I need also a query where i can find the lowest val + 1 from the table Is this query a good way to do this ?
SELECT val + 1 FROM test t
WHERE val NOT IN
(SELECT val FROM test
WHERE val=t.val+1)
PS: sorry for my english
Ciao,
Joe
E-Mail: josef.huber_at_ennstal.at
Home: http://www.liezen-online.at
Received on Wed Jan 28 1998 - 00:00:00 CST