This question is locked. New answers and comments are not allowed.
create table table1
(
BienLaiID int,
SoTien money,
NhomID int
)
insert into table1
select 1, 50, 1
union all
select 1,10,1
union all
select 2,100,2
union all
select 3,90,3
Create table table2
( NhomID int
)
insert into table2
select 1
union all
select 2
union all
select 3
union all
select 4
union all
select 5
with t1 as
(
select distinct BienLaiID
from table1
)
select t1.BienLaiID, table2.NhomID, table1.SoTien
from t1
cross join table2
left join table1 on t1.BienLaiID = table1.BienLaiID and table2.NhomID=table1.NhomID
//----
How to turn on sql query syntax to query in linq?
Thanks!
(
BienLaiID int,
SoTien money,
NhomID int
)
insert into table1
select 1, 50, 1
union all
select 1,10,1
union all
select 2,100,2
union all
select 3,90,3
Create table table2
( NhomID int
)
insert into table2
select 1
union all
select 2
union all
select 3
union all
select 4
union all
select 5
with t1 as
(
select distinct BienLaiID
from table1
)
select t1.BienLaiID, table2.NhomID, table1.SoTien
from t1
cross join table2
left join table1 on t1.BienLaiID = table1.BienLaiID and table2.NhomID=table1.NhomID
//----
How to turn on sql query syntax to query in linq?
Thanks!