mbeals Posted June 2, 2008 Share Posted June 2, 2008 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 Quote Link to comment Share on other sites More sharing options...
fenway Posted June 2, 2008 Share Posted June 2, 2008 Why not SELECT DISTINCT site, device? Quote Link to comment Share on other sites More sharing options...
mbeals Posted June 2, 2008 Author Share Posted June 2, 2008 thanks, Wasn't aware I could do that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.