Wednesday, April 7, 2010

SELECT - SQL Command

0 comments
Select Syntax

Purpose: Retrieves data from one or more tables

The following code examples show many ways of retrieving data with the SQL SELECT command

Example#1 Select Fields
SELECT emp_id, e_name FROM Employee

Example#2 Using Alias
displays all records from a query in a specified column using the AS Column_Name clause

SELECT city_name AS 'City' FROM customer

Example#3 Top 10 valus in SQL SERVER

SELECT top 10 * FROM customer


Example#4 Top 10 valus in MySQL

SELECT * FROM customer
limit 10


Example#4 Second Largest value in MySQL

SELECT * FROM customer
limit 2,2



0 comments: