score:2

Accepted answer

do something like this : (update column name as per yours)

var query = (from c in testresult
        join tbl2 in testresultrelated on c.id equals tbl2.testresult 
        where c.user_login_name = 'emilwkj' and tbl2.data != ''
        orderby tbl2.data
        group tbl2 by tbl2.data into g
        select new 
        {
            id = g.key.id,
            name = g.key.name,
            testresultrelated = g
        })
        .distinct()   //.distinct(x=>x.somecolumn) 
        .orderbydescending(x => x.date);
        .take(10)

score:0

as we understand you are using efcore and dbcontext heaving testresult and testresultrelated table.

here is the code of problem that we understand from your question.

var db=new dbcontext();
var result = (from a in db.testresult
             join b in db.testresultrelated on a.id equals b.testresult
             where b.path == "testresultrelatedadditionaldata.softwareversion"
             & a.user_login_name == "emilwkj" & b.data!=" "
             group b by b.data into item
             orderby item.max(e=>e.start_date_time) descending
             select item)
             .take(10);

Related Query

More Query from same tag