我有一张包含以下数据的表格
-------------------
ID Key Value
-------------------
1 1
2 0
3 1
4 0
5 0
6 0
7 1
8 0
9 0
--------------------
Run Code Online (Sandbox Code Playgroud)
我想更新Value列,如下所示
-------------------
ID Key Value
-------------------
1 1 0
2 0 1
3 1 0
4 0 3
5 0 2
6 0 1
7 1 0
8 0 0
9 0 0
--------------------
Run Code Online (Sandbox Code Playgroud)
也就是说,每个Key= 1将具有Value= 0.每个Key= 0将具有Value=从当前行到行的遍历数Key= 1.并且最后两个Key,因为没有跟随'1',将具有Value= …
我有权访问两个架构.其中只有一个具有创建数据库链接的优先权.我希望其他架构也使用此DB链接.此外,我没有创建公共数据库链接的意图.这在Oracle SQL中是否可行?
我正在尝试重写下面的查询,用内连接替换'IN'子句
select * from employee_rec er
inner join ed_claim_recd ed on er.ssn=ed.insssn and substr(er.group_rec_key,1,10) = substr(er.group_rec_key,1,10)
and ed.claim in (select claimno from cd_claim_recd cd where cd.closedt is not null and cd.closedt != '0000000' and cd.closedt >= '2130101')
and ed.insssn in (select er1.ssn from employee_rec er1 where er1.status != 'ACTIV' and trim(ER1.CLAIMNO) is null)
and er.sysind not in ('ABC,'BCD')
Run Code Online (Sandbox Code Playgroud)
以下是我可以提出的结果,但结果与之前的查询不同
select * from employee_rec er
inner join ed_claim_recd ed on er.ssn = ed.insssn and substr(er.group_rec_key, 1, 10) = substr(er.group_rec_key, 1, 10) …Run Code Online (Sandbox Code Playgroud)