Beginning SQL

Beginning SQL Beginning SQL

marjan.fesb.hr
from marjan.fesb.hr More from this publisher
20.07.2013 Views

The BETWEEN operator functions exactly the same way, except it’s shorter — it saves on typing and also makes the SQL more readable. The following SQL uses the BETWEEN operator to select films with a rating between 3 and 5: SELECT FilmName, Rating FROM Films WHERE Rating BETWEEN 3 AND 5 If you use the BETWEEN operator, you see that it provides exactly the same results as the “greater than or equal to” (>=) and “less than or equal to” (

The BETWEEN operator functions exactly the same way, except it’s shorter — it saves on typing and also<br />

makes the <strong>SQL</strong> more readable. The following <strong>SQL</strong> uses the BETWEEN operator to select films with a rating<br />

between 3 and 5:<br />

SELECT FilmName, Rating<br />

FROM Films<br />

WHERE Rating BETWEEN 3 AND 5<br />

If you use the BETWEEN operator, you see that it provides exactly the same results as the “greater than or<br />

equal to” (>=) and “less than or equal to” (

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!