How would I find the 11th entry in an Access SQL database table? I have to use the TOP function, and my query currently looks like this:
SELECT TOP 11 Pass
You can use a subquery:
SELECT TOP 1 T.Name, T.[Total Amount Spent on Tickets]
FROM
(SELECT TOP 11 Passenger.Name, SUM(Manifest.Ticketprice) AS [Total Amount Spent on Tickets]
FROM Passenger INNER JOIN Manifest ON Passenger.PassengerNumber=Manifest.PassengerNumber
GROUP BY Passenger.Name
ORDER BY SUM(Manifest.Ticketprice) DESC) As T
ORDER BY T.[Total Amount Spent on Tickets] ASC
SELECT TOP 11 Passenger.Name, SUM(Manifest.Ticketprice) AS [Total Amount Spent on Tickets]
FROM Passenger INNER JOIN Manifest ON Passenger.PassengerNumber=Manifest.PassengerNumber
GROUP BY Passenger.Name
ORDER BY SUM(Manifest.Ticketprice) DESC LIMIT 1;