About 992,000 results
Open links in new tab
  1. sql - Delete duplicate rows keeping the first row - Stack Overflow

    10 To delete the duplicate rows from the table in SQL Server, you follow these steps: Find duplicate rows using GROUP BY clause or ROW_NUMBER () function. Use DELETE statement to remove the …

  2. How can I delete using INNER JOIN with SQL Server?

    Sep 10, 2016 · I want to delete using INNER JOIN in SQL Server 2008. But I get this error: Msg 156, Level 15, State 1, Line 15 Incorrect syntax near the keyword 'INNER'. My code: DELETE FROM …

  3. sql - Delete from two tables in one query - Stack Overflow

    If you do this in two queries, you really should wrap this in a transaction. As for running delete queries in a loop, you are better off formulating a single query to do all the deletes.

  4. sql - How can I delete one of two perfectly identical rows? - Stack ...

    May 8, 2013 · The MySQL-specific LIMIT row_count option to DELETE tells the server the maximum number of rows to be deleted before control is returned to the client. This can be used to ensure that …

  5. SQL Delete based on condition in join - Stack Overflow

    Jul 11, 2015 · It is possible to delete records based on a satisfied condition with a join query? For instance, I have a linking table joining 3 records. The query I have at the moment deletes records …

  6. How to delete multiple rows in SQL where id = (x to y)

    I am trying to run a SQL query to delete rows with id's 163 to 265 in a table I tried this to delete less number of rows DELETE FROM `table` WHERE id IN (264, 265) But when it comes to delete...

  7. T-SQL: Selecting rows to delete via joins - Stack Overflow

    Feb 22, 2016 · T-SQL: Selecting rows to delete via joins Asked 16 years, 11 months ago Modified 4 years, 10 months ago Viewed 452k times

  8. How to write a SQL DELETE statement with a SELECT statement in the ...

    Jul 9, 2013 · Just be sure to put the table name (or an alias) between DELETE and FROM to specify which table you are deleting from. This is simpler than using a nested SELECT statement like in the …

  9. How to keep only one row of a table, removing duplicate rows?

    I have a table that has a lot of duplicates in the Name column. I'd like to only keep one row for each. The following lists the duplicates, but I don't know how to delete the duplicates and just k...

  10. How do I delete from multiple tables using INNER JOIN in SQL server

    Apr 24, 2009 · In MySQL you can use the syntax DELETE t1,t2 FROM table1 AS t1 INNER JOIN table2 t2 ... INNER JOIN table3 t3 ... How do I do the same thing in SQL Server?