Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

distinct For only one column

SELECT *
  FROM (
                SELECT  ID, 
                        Email, 
                        ProductName, 
                        ProductModel,
                        ROW_NUMBER() OVER(PARTITION BY Email ORDER BY ID DESC) rn
                    FROM Products
              ) a
WHERE rn = 1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #distinct #For #column
ADD COMMENT
Topic
Name
4+4 =