2个简单的MYSQL语句?

2个简单的MYSQL语句?,第1张

$sql_a="selete id from A like 110% or like %110"

$query_a=mysql_quey($sql_a)

$rs_a=mysql_fetch_array($quey_a)

$sql_del_a="delete from A where id=".$rs_a['id']

=mysql_query($sql_del_a)

if($query_del_a>0){

echo "删除成功!"

}

$sql_b="selete id from B like %100%"

$query_b=......($sql_b)//同上

$rs_b=.................($quey_b)//同上

$sql_del_b="delete from B where id=".$rs_b['id']

.

.

.

create database test_dbuse test_dbcreate table student(id int auto_increment not null,name varchar(20),class varchar(20),primary key(id))create table course(id int auto_increment not null,name varchar(20),primary key(id))create table takes(id int auto_increment not null,takes_student int,takes_course int,score int(2),primary key(id))alter table takes add constraint fk_takes_student foreign key (takes_student) references student (id) on delete set null on update cascadealter table takes add constraint fk_takes_course foreign key (takes_course) references course (id) on delete set null on update cascade

select * from userinfo where article_name in (select top 3 article_name from userinfo where mc_time = '2009/09/03' group by article_name order by count(*) desc )

如果只要article_name

select top 3 article_name from userinfo where mc_time = '2009/09/03' group by article_name order by count(*) desc


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/7515727.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-06
下一篇 2023-04-06

发表评论

登录后才能评论

评论列表(0条)

保存