All About SQL Functions - More Aggregate Functions (Page 2 of 6 )
If we want to see what the first record in our Name column contains, we could use the First(column) function.
Select First(Name)
From Employees
This will result in the following:
Darth Brooks
We could also sort the table first if we wanted to, allowing us to get the first alphabetical person in the table:
Select First(Name)
From Employees
Order by Name
This would return:
Baklava
Similarly, we could use the Last(column) Function to retrieve the last piece of data in a column:
Select Last(Position)
From Employees
This would give us:
Hairy Co-Pilot
And again we could also sort the data before choosing the last record:
Select First(Position)
From Employees
Order by Position
Here our result would be:
Bounty Hunter Agent
Next: STDEV >>
More BrainDump Articles
More By James Payne