O'Reilly logo

Just Java™ 2 by Peter van der Linden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Querying and Retrieving Data

The SELECT statement is used to query a database and get back the data that matches your query.

The SELECT statement has this general format:

Format of SQL SELECT statement

Additional information

SELECT   Name1  ,Name2  ,Name3 ...     <— can mention one or more columns, or "*" for FROM                             all columns    tablename1, tableName2, ...   <— can mention one or more tables WHERE       conditions                 <— the "WHERE" clause is optional and can ORDER BY  colNames               be omitted ;                                <— the "ORDER BY" clause is optional and can                                  be omitted                                      It returns the data sorted by this field ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required