Mysql 入门,增删改查(进阶篇)
时间:2021-07-01 10:21:17
帮助过:27人阅读
select id,tel
from students
where id
in(
2,
6) and tel
not in(
‘18392868125‘); #从students表中,取出id在2和6之间的,并且tel不为‘18392868125’的数
2)
select id,tel
from students
where tel = ‘18392868125‘
limit 1; #拉出一条tel为18392868125的数据
3)
select distinct tel
from students; #拉出tel列去重数据
运行结果示例图如下:
2、UPDATE
update students set name=(select name from students_score where id = 4 ) where id = 3; #已students_score的id=4的name值,赋值给students的id=3的name值
Mysql 入门,增删改查(进阶篇)
标签:分享 nbsp update limit 技术 技术分享 bsp upd 去重