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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.