Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!in.100proofnews.com!in.100proofnews.com!news-out.visi.com!hermes.visi.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews1.google.com!not-for-mail
From: pretorianboy@yahoo.com (Pret Orian)
Newsgroups: comp.databases.oracle.server
Subject: Select between range, not in...
Date: 12 Dec 2003 09:48:44 -0800
Organization: http://groups.google.com
Lines: 22
Message-ID: <9849ae9d.0312120948.36f1c223@posting.google.com>
NNTP-Posting-Host: 213.47.46.210
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1071251325 22301 127.0.0.1 (12 Dec 2003 17:48:45 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 12 Dec 2003 17:48:45 +0000 (UTC)
Xref: newssvr20.news.prodigy.com comp.databases.oracle.server:249996

Hi there!
I have a table with used IP Adresses, and I have a table with
subnetworks (with IP range: start/end).
I need to make a select statement which would return the first free IP
in range.
The catch is I'd need to find a solution that would use basic SQL
query as I have no permission to write SPs or functions.

So this would be the table structures:

Subnet:
sune_id, ipstart, ipend, ...

IPs:
..., sune_id, ipadress

note, ipstart, ipend and ipadress are plain integers (i.e. 4-Byte
adresses downcalculated to integers, so you can refer to them
acordingly).

TIA
PB
