L
L
Laurchi2020-10-22 19:38:45
PostgreSQL
Laurchi, 2020-10-22 19:38:45

How to check if IP address is in range?

Hello. Please help with advice!
I have 2 tables - in one ip address of clients (ip, cust_name), and in the other ip_from, ip_to, country
I need ip addresses only of clients from Russia. Accordingly, it is necessary that the IP from the first table is included in the range ip_from, ip_to . How to do it? I understand that you need to specify in where country_name = 'Russia', I even used the with a as subquery.
It does not work in any way, or it gives an error, because everything is read too long ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2020-10-22
@ky0

Of course it will take a long time. Addresses, I suppose, are stored in strings, and not in a type specially designed for this ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question