我有这样的SQL查询我需要一些帮助来写这个LINQ查询
select case when AllowanceId is null then 2 else AllowanceId end as AllowanceId
, d.descen as domdescen
, t.descen as typdescen
, case when qty is null then 0 else qty end as qty
, u.descen as unidescen
from (select t.allowancetypeid, d.allowancedomainid
from allowancedomain as d, allowancetype as t
where t.allowancetypeid in (1,2) and d.active = 1 and t.active = 1) as a left join
allowanceqty as q on a.allowancetypeid = q.allowancetypeid and
a.allowancedomainid = q.allowancedomainid and
q.allowanceid = 2 inner join
allowancedomain as d on a.allowancedomainid = d.allowancedomainid
inner join
allowancetype as t on a.allowancetypeid = t.allowancetypeid
inner join
unit as u on case when q.unitid is null then 1 else q.unitid end = u.unitid
存在这样的查询一个变量,它在SELECT子句(第一行)2号和“= 2 “在FROM子句(中)
我写了我想要的东西,看看下面
你能告诉我linqer会为我的sql查询生成什么吗? – Fredou 2009-08-27 12:45:53