日期:2014-05-20  浏览次数:20844 次

求一句sql语句.
SQL code
select * from t_item a left join(select * from products) b on a.shopid=b.id where a.userid=15 and a.brandid=12


这个sql语句用linq to sql来表达,该怎么表达

------解决方案--------------------
帮顶 今天看了一天linq 硬是写不出来
------解决方案--------------------
var q =
from a in db.t_item 
join b in db.products on a.shopid== b.id equals into bc
from c in bc
where a.userid=15 and a.brandid=12
select a;
------解决方案--------------------
2楼正解
------解决方案--------------------
on a.shopid equals b.id into bc ?
------解决方案--------------------
var q = 
from a in db.t_item 
join b in db.products on a.shopid equals b.id
where a.userid=15 and a.brandid=12 
select a;
------解决方案--------------------
它得语法和SQL差不多。
------解决方案--------------------
.................
------解决方案--------------------
2楼 正解
------解决方案--------------------
探讨
var q =
    from a in db.t_item
    join b in db.products on a.shopid== b.id equals into bc
    from c in bc
    where a.userid=15 and a.brandid=12
    select a;

------解决方案--------------------
2楼对了。
------解决方案--------------------
2楼 正解了,楼主接贴