この SQL クエリを nhibernate に変換する必要があります
declare @i int set @i=2
while (@i>0)
begin
insert into #tmp_table3 (id , descr , RangeType , createdate )
select * from AgeRanges as ar where AgeRangeID in (
select AgeRangeID as id from AgeRangeDetails where agerangeid in
(select AgeRangeID from agerangedetails group by AgeRangeID having COUNT(AgeRangeID)=2)
and agestart =(select AgeStart from #tmp_table2 where id=@i)
and AgeEnd = (select AgeEnd from #tmp_table2 where id=@i)
and Payment = (select Payment from #tmp_table2 where id=@i)
group by AgeRangeID)
and AgeRangeType=0
and AgeRangeID<>5
set @i=@i-1
end
select id from #tmp_table3 where id in
(select id from #tmp_table3 group by id having COUNT(id)=2) group by id
誰かが私にこれを手伝ってもらえますか。ありがとう