当前位置: 代码迷 >> Sql Server >> 关于一个HQL语句 急该如何处理
  详细解决方案

关于一个HQL语句 急该如何处理

热度:55   发布时间:2016-04-24 19:01:44.0
关于一个HQL语句 急急急………………
from InvestmentScheduleD isd inner join fetch isd.investmentScheduleH ish inner join ish.investmentPlanH iph inner join iph.investmentPlanD ipd where isd.PlanStepID = ipd.PlanStepID and iph.InvestmentPlanStatus =1 and  ish.InvestmentScheduleHStatus=1 

  此语句关系到的有四张表InvestmentScheduleD   investmentScheduleH    investmentPlanH   investmentPlanD

  请问写成sql应该怎么写  
------解决方案--------------------
from
 InvestmentScheduleD isd 
inner join
 investmentScheduleH ish 
on
 isd.PlanStepID = ish.PlanStepID 
inner join
 investmentPlanH iph 
on
 isd.PlanStepID = iph.PlanStepID
inner join
 investmentPlanD ipd 
on
 isd.PlanStepID = ipd.PlanStepID
where
 iph.InvestmentPlanStatus =1 and ish.InvestmentScheduleHStatus=1  

------解决方案--------------------
select *  
from InvestmentScheduleD ,investmentScheduleH ,investmentPlanH ,investmentPlanD
where ...--这里把关系加上即可.
  相关解决方案