i have a table that has event name and event date.
if i want to get the last 10 events by date, can i do that by sql or do i need query the whole table and do the filtering in code.
i have a table that has event name and event date.
if i want to get the last 10 events by date, can i do that by sql or do i need query the whole table and do the filtering in code.
This assumes that "the last 10 by event date" means the 10 most recent ones:
SELECT TOP 10 EventName, EventDate
FROM EventsTable
ORDER BY EventDate DESC
That should do it - regardless of what database system you're using.
Marc