1 Reply Latest reply on Mar 14, 2016 8:59 AM by Kelton

    Finding duplicate values with a query?

    nogden Rookie

      I'm trying to generate a list of all computers that, in general, have 2 or more of a value; but not a specific value.


      For instance, we have multiple computers show up with the same Service Tag. We can see if there is more than one of a specific service tag by typing it into the search field on the console, but we would like a list to be pulled up of all computers that have duplicate information. I'm using service tag for this post as that is what we are currently searching through, but I'm supposing this would be good for pulling up any other information that is suppose to be unique to one machine like mac address, conflicting IP, etc.


      FYI using LANdesk Management Console


      Thanks in advance!

        • 1. Re: Finding duplicate values with a query?
          Kelton SupportEmployee

          The exact functionality you are looking is not directly built into LANDesk. While the LANDesk console uses SQL to run it's queries in the console, it is not as robust as an actual SQL server when it comes to writing queries. However, we can use the console to help us write the query and run it directly from a SQL server. Since you are trying to find devices that have the same service tag you can create a query in LANDesk like so (I chose Computer.BIOS.Service Tag but you can use whatever value you would like):



          Once the query is created, right click the query in the console window and select "Inspect":




          And then copy the SQL script into a SQL query window:




          The whole point of creating the query and inspecting it is to find out exactly in the DB where the information you are trying to query off of is stored.


          Once you have the SQL query, it is just a matter of modifying the query to meet your needs (add a Having Count clause to the statement).