User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Jan 2008
Posts: 2
Reputation: Scottied43 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Scottied43 Scottied43 is offline Offline
Newbie Poster

Ambiguous Data Trouble

  #1  
May 23rd, 2008
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2008
Posts: 295
Reputation: tesuji is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 41
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: Ambiguous Data Trouble

  #2  
May 23rd, 2008
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
Reply With Quote  
Join Date: Dec 2007
Posts: 114
Reputation: mwasif is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 14
mwasif mwasif is offline Offline
Junior Poster

Re: Ambiguous Data Trouble

  #3  
May 25th, 2008
Originally Posted by tesuji View Post
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

  1. SELECT IP_Addr FROM ip_addresses
  2. GROUP BY IP_Addr
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the MySQL Forum

All times are GMT -4. The time now is 6:55 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC