About Me

Thursday, 19 April 2012

SQL - Predicates

SQL - Predicates

SQL Predicates are found on the tail end of clauses, functions, and SQL expression inside of existing query statements. We've actually already covered a few SQL predicates already and most on this list should be familiar to you.

SQL Predicates:

AND
OR
LIKE
BETWEEN
AS
TOP(LIMIT)

SQL - Top

SQL Top is used to limit the number of results returned by a query. The top command is generally followed by a number that indicates the maximum number of results to return for a given query.

SQL Code:

use mydatabase;

SELECT TOP 2 *
FROM orders

SQL Results:

idcustomerday_of_orderproductquantity
1Tia2008-08-01 00:00:00.000Pen4
2Tia2008-08-01 00:00:00.000Stapler3

0 comments:

Post a Comment