SQL Tips
A boat with beautiful sunset.
Tree in field with blue sky.
Amaizing sunrise moment
Sunday, March 18, 2012
Limiting the Rows Selected
We can restrict the rows returned from the query by using the WHERE clause.
Syntax :
SELECT * | { [DISTINCT] column / expression [alias],...} FROM table [WHERE condition ];
Example :
SELECT name,job,FROM dept WHERE emp_id = 101;
Display Table Structure
This key word is used to display the entire table.
Example :
DESCRIBE tablename;
Duplicate Rows
It is use to eliminating Duplicate Rows.
This keyword eliminate the duplicate rows in the tables.
Example :
SELECT job FROM dept;
SELECT DISTINCT job FROM dept;
Saturday, March 17, 2012
Literal Character
It is a character, number or date included in the SELECT list.
Date and character literal values should be with in single quotation marks.
Example :
SELECT name || ' is a '|| job AS "Employee Details" FROM dept;
Concatenation Operator
You can link the the columns to other columns by using concatenation operator(||).
Creates a resultant column that is a character expression.
Example :
SELECT name || job AS "Employees" FROM dept;
Older Posts
Home
Subscribe to:
Comments (Atom)