| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL command
"Ksous Mekki" <ksousm_at_draexlmaier.de> wrote in message
news:3b5251eb.0108300019.7b7dcb54_at_posting.google.com...
> What is the SQL command or the solution, to find stations that their
> tcp_ips are between (193.50.130.25 and 193.50.130.100).
> NB: column tcp_ip is type VARCHAR2(15)
THe followings should give you the idea. I have no comment on the efficiency of this code
SQL> select * from tab;
IP_COL
193.50.30.21 193.50.30.26 193.50.30.50 193.254.30.50 193.50.30.50 193.50.30.254
6 rows selected.
SQL> select ip_col from tab
2 where substr(ip_col,1,9) = '193.50.30'
3 and to_number(substr(ip_col,11,3)) between 25 and 75;
IP_COL
193.50.30.26 193.50.30.50 193.50.30.50
SQL>
-- Niall Litchfield Oracle DBA Audit Commission UKReceived on Thu Aug 30 2001 - 04:55:14 CDT
![]() |
![]() |