关于一个HQL语句 急急急……………… 40zbb0723]

发布时间:2014-1-1 0:09:47
来源:分享查询网

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 ...--这里把关系加上即可.

返回顶部
查看电脑版