Here is what I want to accomplish:
I have a table that stores the computer name in one column and a a software title in another. The computer name can be listed numerous times based on how much software is installed. There are also multiple computers. So I could have Computer1 listed 10 times with 10 different pieces of software installed and computer2 listed 15 times with 15 different pieces of software installed.
I want to write a query that will query the table and return just the name of the computer and only return it once. That way I can populate a list with computers that have entries in that table.
Is it possible or should I look into redesigning so that the computers go in one table only once and in another table list the software and link it to the computers table?
If you need to query from the table mentioned above then use the distinct operator.1
From w3 schools:
In a table, a column may contain many duplicate values; and sometimes you only want to list the different (distinct) values. The DISTINCT keyword can be used to return only distinct (different) values.
I.e. Select distinct computer name from table.
Otherwise, it is more efficient to select the computer names from a computers table where you can prevent having to use the distinct key word.