数据库学习(day2)
1.SQL delete语法.
DELETE FROM table_name
WHERE some_column=some_value;
http://www.runoob.com/sql/sql-delete.html
2. 关于删除的三个语句DROP/TRUNCATE/DELETE
DROP test; ---删除表test,并且释放空间,test被完全删除
TRUNCATE test; ----删除表test中的内容,并释放空间,但不删除表的定义,表的结构还在
DELETE FROM test WHERE age=30 AND country='us'; ---删除指定数据
DELETE FROM test;
DELETE * FROM test;--------仅删除表内所有内容,保留表的定义,不释放空间。
SQL SELECT TOP, LIMIT, ROWNUM | 菜鸟教程
SQL SELECT TOP字句用法:
用于规定返回的记录的数目
SQL Server/MS Access 语法
SELECT TOP number|percent column_name(s)
FROM table_name;
MySQL 语法
SELECT column_name(s)
FROM table_name
LIMIT number;
Oracle 语法
SELECT column_name(s)
FROM table_name;
WHERE ROWNUM <= number;