Difference between revisions of "SELECT .. WHERE"

From SQLZOO
Jump to: navigation, search
(Created page with " <h1>SELECT .. WHERE</h1> <p>The table <code>games</code> shows the year and the city hosting the Olympic Games.</p> <table> <caption align='center'>games</caption> <tr><th al...")
 
Line 9: Line 9:
 
<tr><td>2008</td><td align='left'>Beijing</td></tr>
 
<tr><td>2008</td><td align='left'>Beijing</td></tr>
 
<tr><td>2012</td><td align='left'>London</td></tr>
 
<tr><td>2012</td><td align='left'>London</td></tr>
 +
</table>
 
<div class='ht'>
 
<div class='ht'>
 
The SELECT statement returns results from a table.  
 
The SELECT statement returns results from a table.  
Line 14: Line 15:
 
In this example shows the year that Athens hosted the Olympic games.  
 
In this example shows the year that Athens hosted the Olympic games.  
 
<div class=params>schema:scott</div>
 
<div class=params>schema:scott</div>
<source lang='sql' class='def e-oracle'>
 
SELECT yr, city
 
FROM gisq.games
 
</source>
 
 
<source lang='sql' class='def'>
 
<source lang='sql' class='def'>
 
SELECT yr, city  
 
SELECT yr, city  

Revision as of 16:37, 16 July 2012

SELECT .. WHERE

The table games shows the year and the city hosting the Olympic Games.

games
yrcity
2000Sydney
2004Athens
2008Beijing
2012London

The SELECT statement returns results from a table. With a WHERE clause only some rows are returned. In this example shows the year that Athens hosted the Olympic games.

schema:scott
SELECT yr, city 
FROM games

See also

Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense