1. Retrieving Records
Retrieving All Rows and Columns from a Table
select * from emp;Finding Rows That Satisfy Multiple Conditions
select * from emp where ( deptno = 10 or comm is not null or sal <= 2000 )
and deptno=20Providing Meaningful Names for Columns
select sal as salary, comm as commission from emp;Referencing an Aliased Column in the WHERE Clause
-- Will not work
select sal as salary, comm as commission from emp where salary < 5000
-- Will work
select * from (select sal as salary, comm as commission from emp) x where salary < 5000;Concatenating Column Values
Using Conditional Logic in a SELECT Statement
Limiting the Number of Rows Returned
Returning n Random Records from a Table
Finding Null Values
Transforming Nulls into Real Values
Searching for Patterns
Last updated