Microsoft Access Database Development With VBA

SQL Keywords: BY



The BY keyword is used to complete another keyword in a SQL expression.

The BY keyword can be preceded by the ORDER keyword to create an ORDER BY expression. The ORDER BY expression is used to sort the records of a set in ascending order. The formula to follow is:

SELECT What FROM WhatObject ORDER BY WhatField;

Here is an example that selects two field from a table:

SELECT FirstName, LastName FROM Employees ORDER BY LastName;

Here is another example:

SELECT * FROM Employees ORDER BY LastName;

Home Copyright © 2009-2016, FunctionX, Inc. Home