Hello , i have a problem involving MAX(). I have a table with a series of columns. Now lets say i have two columns , one named Sleeping_Time and the other Start_Time, the table is call Gross_Sleep_Timetable. I want to sort the Start Time using the Maximum value of Sleeping time. So i want to get the Start Time based in the row where the Max() value of Sleeping Time is located. How would i do so? I also want the values to change according to dynamic filters i have to General Timetable. This means i can select different MAX() values of Sleeping Time in a list, and get different values of Start Time in a list. I tried implementing a nested loop in my Select function, but it returned multiple values.
From Gross_Sleep_Timetable gs
where gs.Sleeping_Time=(Select Max(gst.Sleeping_Time))