About 35,000 results
Open links in new tab
  1. How can I exclude duplicate records from sql query

    Aug 25, 2016 · The explanation for what you are seeing most likely is that the records you are getting back are not duplicates. For example, if you used SELECT *, then you would be getting back all columns, and even though the employee name, id, etc. columns could be identical for multiple records, the other columns might be distinct.

  2. SQL - Remove the duplicate Results - Stack Overflow

    You can use the DISTINCT in SQL Server to get the distinct records only. Apart from this you can also use the ROW_NUMBER (Transact-SQL) function to get the distinct result by assigning the numbers to a result set. The syntax of row_number() is as shown below. ROW_NUMBER ( ) OVER ( [ PARTITION BY value_expression , ... [ n ] ] order_by_clause )

  3. Removing duplicates from a SQL query (not just "use distinct")

    Feb 7, 2014 · If I understand you correctly, you want to list to exclude duplicates on one column only, inner join to a sub-select. select u.* [whatever joined values] from users u inner join (select name from users group by name having count(*)=1) …

  4. sql - How to eliminate duplicates from select query ... - Stack …

    Oct 16, 2016 · For PostgreSQL as well as SQL Server 2005+, DB2 and later versions of Oracle (9+), you can use the windowing function ROW_NUMBER() select * from ( select *, ROW_NUMBER() over (partition by userID order by yr desc) rown ) X where rown = 1

  5. SQL How to remove duplicates within select query?

    Sep 12, 2010 · Removing SQL Duplicates via SELECT. 0. SQL - remove duplicates from query. 0.

  6. sql - Eliminating duplicate values based on only one column of the ...

    Jul 7, 2013 · SQL Query: Remove duplicates in column that is not primary key. 9. Removing duplicates from one column ...

  7. sql - join two different tables and remove duplicated entries

    Jan 13, 2013 · I'm complete novice in sql queries. I have two tables: table1: id_s name post_code city subject ----- 1 name1 postal1 city1 subject1 2 name2 postal2 city2 subject2 3 name3 postal3 city3 subject3 4 name4 postal4 city4 subject4 ... ~350 table2:

  8. sql - how to exclude rows that have duplicates in one field - Stack ...

    Jul 27, 2010 · This query will select the first article (lowest id) from each category. SELECT a.* FROM Article a LEFT JOIN Article a2 ON a.id<a2.id AND a.cat_id=a2.cat_id WHERE a2.id IS NULL

  9. mysql - SQL: How to select rows from a table while ignoring the ...

    How to select rows from a table while ignoring the duplicate field values? Here is an example: id user_id message 1 Adam "Adam is here." 2 Peter...

  10. sql server - SQL Query to exclude duplicates - Stack Overflow

    Apr 3, 2018 · SQL Query to exclude duplicates. Ask Question Asked 6 years, 11 months ago. Modified 6 years, 11 months ago.

Refresh