跪求Oracle的sql语句 谢谢!!
发布网友
发布时间:2022-04-09 03:48
我来回答
共3个回答
热心网友
时间:2022-04-09 05:17
1、select a.g_apply from g_cardapply a,g_cardapplydetail b where a.g_applyno=b.g_applyno and b.g_idcard='440401430103082';
2、select b.g_idcard,count(b.g_idcard) from g_cardapplydetail b group by b.g_idcard having count(b._idcard)>2;
3、update g_cardapply a,g_cardapplydetail b set a.g_state='07' where a.g_applyno=b.g_applyno and b.g_idcard='440401430103082';
update g_cardapplydetail b set b.g_state='07' where b.g_idcard='440401430103082';
4、delete from g_cardapplydetail where g_name like '李%';
热心网友
时间:2022-04-09 06:35
create table g_cardapply(
g_applyno varchar(8) not null primary key,
g_apply date bigint(8),
G_state Varchar(2) not null
)
create table g_cardapplydetail
( g_applyno Varchar primary key ,
g_name Varchar(30) not null,
g_idcard Varchar(18) not null,
g_state Varchar(2) not null,
foreign key (g_applyno) references g_cardapply(g_applyno)
)
1、insert into g_cardapply values(您要填写这些数据)
insert into g_cardapplydetail()
2、select g_idcard,count(1) from g_cardapplydetail group by g_idcard having(count(1)>1)
3、update g_cardapply set g_state='07' where exists (select 1 from g_cardapplydetail where g_cardapplydetail.g_idcard=g_cardapply .g_idcard and g_idcard ='身份证')
update g_cardapplydetail set g_state='07' where g_idcard ='身份证'
4、delete from g_cardapplydetail where g_name like '李%'追问
热心网友
时间:2022-04-09 08:10
select to_char(g_apply,'yyyy/mm/dd') g_apply from g_cardapply,g_cardapplydetail where g_idcard='身份证号' and g_cardapply.g_applyno=g_cardapplydetail.g_applyno
select g_idcard,count(g_idcard) from g_cardapplydetail group by g_idcard having count(g_idcard)>2
update g_cardapply a inner join g_cardapplydetail b
on a.g_applyno =
b.g_applyno and b.g_idcard = '440401430103082'
set a.g_state = '07‘,b.g_state='07'
4.delete from g_cardapplydetail where g_name like '李%'