I FOUND THE ASWER really it was so easy !
$users = DB::select('SELECT TOP (10) Home_LogStudents.LogSt_data, Home_LogStudents.LogSt_date, Home_LogStudents.LogSt_studid, Home_Students.home_firstname, Home_Students.home_lastname
FROM Home_LogStudents
INNER JOIN Home_Students
ON Home_LogStudents.LogSt_studid = Home_Students.home_id
WHERE (Home_LogStudents.LogSt_action = 225)
AND (Home_LogStudents.LogSt_sectionID = '.$id.')
AND (Home_LogStudents.LogSt_date IN
(SELECT MIN(LogSt_date) AS Expr1
FROM Home_LogStudents AS Home_LogStudents_1
WHERE (LogSt_data <> \'0\')
AND (LogSt_action = 225)
AND (LogSt_sectionID = '.$id.') AND (LogSt_studid IN
(SELECT Home_Students_1.home_id
FROM Hw_StudentClasses INNER JOIN
Home_Students AS Home_Students_1
ON Home_Students_1.home_studid = Hw_StudentClasses.Stclass_studid
WHERE (Hw_StudentClasses.Stclass_classid = ' .$class_id.')))
GROUP BY LogSt_studid))
ORDER BY Home_LogStudents.LogSt_data DESC
');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community