w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
VBA/SQL recordsets

Use your query as a subquery and INNER JOIN it back to the [ALL] table to filter the rows.

SELECT
    a.Professor,
    a.Year,
    a.Course,
    a.title
FROM
    [ALL] AS a
    INNER JOIN
        (
            SELECT [All].Professor, [All].Course, Max([All].Year) AS
MaxOfYear
            FROM [All]
            GROUP BY [All].Professor, [All].Course
        ) AS sub
    ON
            a.Professor = sub.Professor
        AND a.Course = sub.Course
        AND a.Year = sub.MaxOfYear;




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.