TIP: Click on subject to list as thread! ANSI
echo: linux
to: TOM MARTIN
from: MAXIM ROMANENKOV
date: 2017-02-04 15:09:00
subject: SQL query in postgres: op

Hi, Tom!

04 фев 17 03:59, Tom Martin -> Maxim Romanenkov:

 TM> SELECT s.ad
 TM> FROM swedro s
 TM> WHERE s.pt='23' AND s.ad NOT IN (
 TM>     SELECT ad
 TM>     FROM swedro
 TM>     WHERE pt'23'
 TM> )

Seems to work nice - even without the "s" alias.
But on a large table about 15M tuples it hangs hard (i'll try to do it in small
portions).

Anyway it's a working solution - just added the grouping by addresses and
removed the alias:

SELECT ad FROM swedro
WHERE pt='23' AND ad NOT IN (
   SELECT ad
   FROM swedro
   WHERE pt '23'
) group by ad
;

Thanx a lot!
Now I can feed this list to nmap.

Best regards, Maxim.

--- -Natural gas is hemispheric.
* Origin: We're concerned about AIDS in our White House... (2:5020/570.35)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.