Jump to content

[SOLVED] Distinct sub query


mbeals

Recommended Posts

I have a table that stores information about IP address assignments for multiple sites.  Each tuple contains the site's name, the device type, it's public (management) IP address and a few other attributes.  The sites are all multihomed, meaning that a single device can be (but doesn't have to be) listed twice in the table, as it would have 2 public IP's.

 

I'm attempting to write a query to list each unique device per site (Ignoring IP).  For instance, take the following set of tuples:

 

SiteDeviceIP

Office 1gateway router123.456.798.1

Office 1gateway router123.456.700.1

Office 1printer123.456.798.2

Labprinter987.654.987.5

 

I need to query to return:

 

SiteDevice

Office 1gateway router

Office 1printer

Labprinter

 

Simple distinct statements won't work.  I'm thinking Its going to have to be a sub query or an alias

Link to comment
https://forums.phpfreaks.com/topic/108376-solved-distinct-sub-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.