•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 428,368 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,453 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 402 | Replies: 2
![]() |
•
•
Join Date: Jan 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
•
•
Join Date: Dec 2007
Posts: 114
Reputation:
Rep Power: 1
Solved Threads: 14
•
•
•
•
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
mysql Syntax (Toggle Plain Text)
SELECT IP_Addr FROM ip_addresses GROUP BY IP_Addr
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access advice broadband business classification code combo crime cult of the dead cow daniweb data data protection data transfer database drive dropdownlist encryption europe forensic forensics gadget google government hacking hard hardware help hitachi hp industrial espionage information internet linux mobile module net news payment services privacy protection reuse search security spot storage terabyte tutorials and more tv web wikipedia
- Previous Thread: get count on selected query of count ??
- Next Thread: realtime query without cronjob


Linear Mode