Конструктор отчетов

Ключ
Эта строка удалена.
Это слово было удалено. Это слово было добавлено.
Эта строка добавлена.

Изменения (3)

просмотр истории страницы
order by 2
{code}
# h5. Отчет по сводобным IP-адресам у указанного пула IP:
{code}
with recursive ip_range(ip) as (
select start_ip from ip_pull where pull_id = ':ID пула$'
union all
select ip + 1 from ip_range
where ip < (select end_ip from ip_pull where pull_id = ':ID пула$')
)
select
uf_ip2string(ir.ip) as "IP адреса"
from ip_range ir
where not exists (
select 1 from users u
left join abonents a on a.id = u.abonent_id
where (u.ip = ir.ip or u.host_ip = ir.ip)
and coalesce(a.deleted, 0) = 0)
order by ir.ip
{code}
h1. Решение проблем