-
Book Overview & Buying
-
Table Of Contents
MySQL for Python
By :
We have already seen how to restrict the data that MySQL returns by using a WHERE clause. Rather than retrieve the entire table and sort through it in Python, we passed the burden onto the server. Using WHERE restricted the number of rows that match. This is just like when we specify columns instead of using an asterisk after SELECT—it saves us from receiving the entire record for every match.
WHERE causes MySQL to ignore any row that does not match our selection. Specifying the columns then indicates to MySQL, which parts of the affected rows to return. In addition to WHERE, MySQL supports other ways of narrowing one's returns. It also allows us to match and complement the data using other tables, including combining tables or results from different queries.
In this chapter, we will see:
How we can restrict results using WHERE and HAVING, and what the differences are between them
When it is best to use WHERE and when one might use HAVING
How to create temporary...
Change the font size
Change margin width
Change background colour