YOUR AD GOES HERE

SQL Tutorial 6: SELECT with LIKE clause and ALIAS to column

Published 28, Nov 2014

Jerry Esperanza


Description:
In addition with clauses that you could combine with SELECT statement, the video shows examples using LIKE, BETWEEN AND in filtering dates, setting an ALIAS name for a column, and deriving a column as a result of a computation. YEAR function is used to derive the year of date column.

Use LIKE clause in filtering string pattern in a column. Use may filter rows or records with a last name that starts with SM or ends with TH or an ER pattern in between. This is use either with a percent sign (%) or underscore (_).

BETWEEN AND clause is not limited in amount ranges. You may use this powerful clause when limiting specific date range.
On most occasions, you may opt to use a different column name or an ALIAS when displaying the column. Use AS operator in column name together with its new name. Experienced SQL users usually drop the AS and specify immediately the alias name. Alias name is enclosed with quotation marks when used.

Working with dates may be simplified if you use specific functions. The given example uses the YEAR () function that derives the year of specific date. YEAR () function is not limited with WHERE condition but works perfectly when used in performing computation with other dates.

The given example shows the 10% increase on salary as you compute it. Combine this with an alias name in order to present your data in a clear manner.

Most of thethese functions and clauses perfectly work with MySQL, Oracle, Informix, MS SQL Server other than DB2.

Link for the ebook will be announced later.

Releted More Videos

You May Also Like

YOUR AD GOES HERE

YOUR AD GOES HERE