Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a code:
C#
var lst1 = from a in tbl1
           select new {Date=a.Date,User=a.User};
var result =  from b in tbl1
              join u in lst1 on b.User equals u.User
              Select b;

I want add 2 statement into 1 statement :
Example:
C#
var result = from b in tbl1
             join (from a in tbl1
                   select new {Date=a.Date,User=a.User};)u
             on b.User equals u.User
             Select b;

Pls help me
Posted
Updated 14-Aug-13 19:23pm
v2
Comments
CodeBlack 15-Aug-13 0:57am    
Is this your actual query or just an example ? If it is an actual query than i dont think that there is a need of join because you are performing join with the same table on the same column amd it will retrieve all the records from the table.
baotdinh 15-Aug-13 3:31am    
I want to resolve this problem :http://www.codeproject.com/Questions/637290/Pls-help-me-about-select-group-in-linq
If you can , pls help me
Sunil Mahanta 15-Aug-13 4:15am    
According to the above link your requirement isn"It will order by date, after that it gets the first group by Name" right ?
baotdinh 15-Aug-13 4:46am    
YES. Now i am getting list Name and Max(date) , after that i join with itselft to get information.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900