Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 1.61 KB

File metadata and controls

41 lines (33 loc) · 1.61 KB
title Exclude Duplicate Rows
ms.custom seo-lt-2019
ms.date 01/19/2017
ms.prod sql
ms.prod_service sql-tools
ms.technology ssms
ms.topic conceptual
helpviewer_keywords
search criteria [SQL Server], excluding rows
row duplicates [SQL Server]
duplicate rows
row excluded in search [SQL Server]
result sets [SQL Server], duplicate values
excluding rows
ms.assetid ab35a363-421d-4665-946b-ae3f6397af50
author markingmyname
ms.author maghan
ms.manager jroth
ms.reviewer

Exclude Duplicate Rows (Visual Database Tools)

[!INCLUDEappliesto-ss-asdb-asdw-pdw-md] If you want to see only unique values in a result set, you can specify that you want to exclude duplicates from the result set.

To exclude duplicate rows from the result set

  1. Right-click the background of the Diagram pane, then choose Properties from the shortcut menu.

  2. In the Property window, click Distinct values and set the value to Yes.

    The Query and View Designer inserts the keyword DISTINCT in front of the list of display columns in the SQL statement.

    [!NOTE]
    If you use the DISTINCT keyword you may not be able to modify the result set in the results pane.

See Also

Specify Search Criteria (Visual Database Tools)
Sort and Group Query Results (Visual Database Tools)