Search
 
SCRIPT & CODE EXAMPLE
 

SQL

delete top N rows in sql

DELETE TOP (top_value) [ PERCENT ] 
FROM table
[WHERE conditions];

/* Parameters or Arguments

table
    The table that you wish to delete records from.
WHERE conditions
    Optional. The conditions that must be met for the records to be deleted.
TOP (top_value)
    It will delete the top number of rows in the result set based on top_value. For example, TOP(10) would delete the top 10 rows matching the delete criteria.
PERCENT
    Optional. If PERCENT is specified, then the top rows are based on a top_value percentage of the total result set (as specfied by the PERCENT value). For example, TOP(10) PERCENT would delete the top 10% of the records matching the delete criteria. 
*/
Comment

delete top 10 rows in sql

/* Put the name of your table in Table*/

DELETE TOP (10)
FROM Table
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql first day of month date 
Sql :: update single sql column 
Sql :: order by oracle 
Sql :: psql change table schema 
Sql :: get count of duplicate records 
Sql :: mysql query first character 
Sql :: what is integrity constraints 
Sql :: how to see the query of a view in mysql 
Sql :: get value from a table an insert it with other values in another table sql 
Sql :: install mysql workbench ubuntu 20.04 
Sql :: Write a query to create an empty table from an existing table? 
Sql :: calculate distance between two latitude longitude postgresql 
Sql :: select row from mysql where date more than 30 days 
Sql :: get primary key of table 
Sql :: sql how to duplicate a table 
Sql :: psql fatal database does not exist 
Sql :: generate sequence number in sql server 
Sql :: inner join sql oracle 
Sql :: mysql cashing error 
Sql :: oracle apex debug mode 
Sql :: install sqlite npm 
Sql :: alter table id autoincrement 
Sql :: check if string contains substring sql 
Sql :: pl/sql procedure example 
Sql :: group_concat in mysql 
Sql :: mysql list tables by size 
Sql :: oracle get running queries 
Sql :: current timestamp in milliseconds mysql 
Sql :: postgresql concatenate multiple rows into one row 
Sql :: how to enable extension in postgreSQL 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =