Hey, could use a little help here. I must be brain dead but I can't think at all, I need help.

I have a table with a bunch of IP addresses in it and a lot of them are the same, how do I --

Remove all the IP's except for one of each?

Like I'll give an example:

IP_Addr
-----------
1.1.1.1
1.1.1.1
1.2.3.4
1.2.3.4
1.2.3.4
1.2.3.4
1.1.1.1
2.2.2.2
2.2.2.2
3.3.3.3
3.3.3.3

how do I get the list to look like

IP_Addr
---------
1.1.1.1
1.2.3.4
2.2.2.2
3.3.3.3.

?????

Please help, much appreciated!

SDM

Hi Scottie,

if you don't have further columns: select distinct ip_addr from ...

Sometimes SQL statement with group by ip_addr also works

krs,

tesu

Hi Scottie,

if you don't have further columns: select distinct ip_addr from ...

Sometimes SQL statement with group by ip_addr also works

krs,

tesu

The SQL statement will look like

SELECT IP_Addr FROM ip_addresses 
GROUP BY IP_Addr
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.