Ok, I'm in need of a little help... I know this is a simple task, but I
need a push since my brain isn't working... I have a database that
allows officers to give tickets to violators... I'm trying to create a
query that joins the violators table (violatorID (primary key), and
OperatorLicenseNumber) and the violations table (violatorID(foreign
key), DateTimeViolation)... I want to be able to return the last record
of a datetimeviolation, and the operatorlicensenumber of that last
violation. How would I go about putting it into code? So far, I've
got:
SELECT a.ViolatorID, OperatorLicenseNumber, DateTimeViolation
FROM Violators AS a INNER JOIN Violations AS b
ON a.ViolatorID = b.ViolatorID
but how do I pull up the last datetimeviolation, along with showing the
violators operatorlicensenumber?
Ugh... I love SQL, but help!