Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - One of each occurence from table
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

One of each occurence from table

 Post Reply Post Reply
Author
pedalcars View Drop Down
Senior Member
Senior Member


Joined: 12 August 2002
Location: United Kingdom
Status: Offline
Points: 268
Post Options Post Options   Thanks (0) Thanks(0)   Quote pedalcars Quote  Post ReplyReply Direct Link To This Post Topic: One of each occurence from table
    Posted: 22 December 2005 at 3:21pm
I have a table of IP addresses and DNS names (of failed hackers, as it happens).

I want to search by DNS name (or part), eg, yetanotherhacker1234.ttnet.net.tr, or just *ttnet.net.tr and find all IP addresses matching that DNS.

However, that could bring back hundreds if not thousands of results, particularly in the case of scripted attacks where there may be 500 or more failed attacks from the same IP address.

So, I want only to see one instance of each IP address for each DNS, eg:

ttnet.net.tr -> 11.22.33.44
ttnet.net.tr -> 11.22.44.66
ttnet.net.tr -> 11.22.55.88

Obviously this could be done by finding all records for the DNS, ordered by IP address, then looping through them and only displaying a record if the IP differed from the previous record. However that seems very inefficient, particularly when there may be thousands of records.

So I need a better way - any solutions gratefully received.

Ta.
www.pedalcars.info

The most fun on four wheels

Back to Top
jeffdaro View Drop Down
Groupie
Groupie


Joined: 15 April 2005
Status: Offline
Points: 171
Post Options Post Options   Thanks (0) Thanks(0)   Quote jeffdaro Quote  Post ReplyReply Direct Link To This Post Posted: 22 December 2005 at 3:25pm
Use SELECT DISTINCT.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.