sql刪除id
Ⅰ sql 語句 批量刪除指定id
刪除整條記錄
delete from a where b like '%.abc'
只是清空含有.ACB的B欄位:
update a set b = null where b like '%.abc'
Ⅱ 用sql語句刪除表中的某個ID
刪除id值為80的行
delete from url where id = 80
Ⅲ SQL 刪除A表中指定時間內的內容和ID記錄
insert
a.id
into
#kkk
select
a.id
from
a,b
where
a.id=b.id
delete
from
a
where
a.id
in(select
id
from
#kkk)
delete
from
b
where
b.id
in(select
id
from
#kkk)
-------------------------
第一句得到兩個表裡的相同記錄並插入臨時表
第二句把A表裡的記錄刪除,條件是#kkk表裡的ID
第三句把B表裡的記錄刪除,條件是#kkk表裡的ID
Ⅳ 如何用sql語句刪除id 號不連續的三個記錄
delete
from
student
where
id
in
('1','4','6')
或者:
delete
from
student
where
id='1'
or
id='4'
or
id='6'
如果id是數字類型的就不用加單引號
Ⅳ sql語句如何刪除主鍵
(1)如圖:刪除下面uid主鍵
語句:ALTER TABLE `6h_360_pay` DROP PRIMARY KEY;
」6h_360_pay「是表名;
(2)如下圖,再創建一個長度為11的int的類型、自增、且不為空的欄位id為主鍵
語句:ALTER TABLE `6h_360_pay`ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST ,ADD PRIMARY KEY (`id`);
Ⅵ sql命令刪除id用SQL語句批量刪除指定ID
delete
from documents
where ID > 5000
Ⅶ sql語句中一下子刪除兩個id的寫法
delete from 表名 where id=1 and id=2
delete from 表名 where id in (1,2)
Ⅷ SQL 刪除多表中一個關聯的ID
級聯刪除
或者觸發器