Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
LAST Function
ORDER BY Clause
GROUP BY Clause
FUNCTION: FIRST
SELECT FIRST(field) AS [expression]
FROM table
[WHERE ...]
[GROUP BY ...]
[ORDER BY ...]
The
FIRST
function is used to return the value of the first record in the designated field Therefore, this function returns a single value. Since the records are returned in an arbitrary order, the first record will also be arbitrary. You can use the
ORDER BY
clause to order the records.
The companion
LAST
function returns the last record in the designated field.
This code finds the first birthdate in a table of MediCare patients that is ordered by the age field.
SELECT FIRST(birthdate) AS FirstBirthDate
FROM MediCarePatients
ORDER BY age
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information