A family of Microsoft relational database management systems designed for ease of use.
Thank you. I remembered that property setting. I wasnt sure what exactly it would do.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello
I have a query with the following results:
| ID | Category |
|---|---|
| 1 | Alpha |
| 2 | Beta |
| 2 | Beta |
| 2 | Beta |
| 3 | Alpha |
| 3 | Gamma |
| 3 | Alpha |
I WANT the results below:
| ID | Category |
|---|---|
| 1 | Alpha |
| 2 | Beta |
| 3 | Alpha |
| 3 | Gamma |
basically, I have an ID Number linked to an incident that can include multiples of different categories. I want my query to ignore the duplicate Categories. I feel like Ive been here before, but I not able to find prior examples of it in my work.
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Thank you. I remembered that property setting. I wasnt sure what exactly it would do.
Group By is used when you have an aggregate column. If you do not have an aggregate column then you use SELECT DISTINCT. If you open the Properties Dialog for the query there is a choice for Unique Values which you would set to Yes.
I wouldn't use GROUP BY in such a case.
Instead, in design mode, set the Unique Values property to Yes. Then run your query.
What does this do exactly. You original query SQL Statement would be something along the lines of
SELECT ID, Category FROM YourTableName;
by changing the aforementioned property, the SQL statement will switch to
SELECT DISTINCT ID, Category FROM YourTableName;
So I literally just posted this.. but I may have figured it out... I just used the "group by" aggregate function and it SEEMS to have worked.... Is this right? Or am I missing something? The only other thing linked to the query is a City. The city stays the same no matter how many different categories are linked to a single ID#...