java面试题

1.SQL中left join,inner join 和right join的区别

left join左连接,查询结果包含满足条件的数据+左边表中的不满足条件的数据

inner join内连接,只查询满足条件的数据

right join  右连接,查询结果包含满足条件的数据+右边表中的不满足条件的数据

2.SQL中表的去重(删除表中重复的数据,只保留一条)

delete FROM
(
select row_number() over(partition by staffId order by STAFFID desc) rn ,* from whsUserCombine
) t where t.rn!=1

3.SQL中跨表数据同步问题

update p set p.AcceptanceDays=t.AcceptanceDays,p.repeatCycle=t.ReInspectionDays,p.protectDate=t.ExpiryDays,
p.buName=t.depCode
from partInfo p
LEFT JOIN ATPStockLimit_temp t on p.partId=t.partId where t.partId is not null

4.SQL中跨表数据新增问题

INSERT INTO partInfo(company,partId,safetyStock,stockUnit,prodInfo,acti)
select company,partId,safetyStock,stockUnit,prodInfo,acti from partInfo_temp t 
where not exists(
select * from partInfo p where p.company = t.company and p.partId = t.partId
)

5.单例模式


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值