DB2 Select

A select statement fetches data from database tables and stores the results in a table called resultset. Your SQL tool displays the contents of the resultset. Following are some sample select statements:
Select all rows

select * from mytable;

Select specific columns

select id, name from mytable;

Select data satisfying a condition

select id, name
from mytable
where year > 2003;

Select data from multiple tables

select a.id, a.name, b.pf
from mytable a, myprofession b;

Renaming resultset columns

select a.id, a.name, b.pf as profession
from mytable a, myprofession b;

Limiting results

select * from mytable
fetch first 10 rows only;