資料庫常用指令之增刪改查分頁
阿新 • • 發佈:2019-01-05
一.mysql的常用增刪改查命令
1. 新增:
INSERT INTO t_users (NAME,Age) VALUES(name,age);
2.刪除:
DELETE FROM t_users WHERE NAME = "name";
3. 修改:
UPDATE t_users SET
Age= "age" WHERE NAME = "name"
4.查詢:
SELECT * FROM
t_users WHERE NAME = "name";
5.分頁
SELECT * FROM
t_users LIMIT (當前頁碼-1)* 每頁記錄數, 每頁記錄數
二、sql server的常用增刪改查命令
1. 新增:
INSERT INTO t_users (NAME,Age) VALUES(name,age);
2.刪除:
DELETE FROM t_users WHERE NAME = "name";
3. 修改:
UPDATE t_users SET Age= "age" WHERE NAME = "name"
4.查詢:
SELECT * FROM t_users WHERE NAME = "name";
5.分頁:
SELECT TOP 頁大小 *
FROM TestTable
WHERE (ID NOT IN
(SELECT TOP 頁大小*頁數 id
FROM
ORDER BY id))
ORDER BY ID