Prev | Current Page 148 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"


Chapter 9
[ 157 ]
Combining Criteria
We can use multiple criteria for the same query (for example, to find all English
books of more than 300 pages). We see here that there are more comparison choices
because of the page_count field being numeric:
Applying a WHERE Clause
Sometimes we may want to enter a search condition that is not offered in the
Function list of the Query by example section; the list cannot contain every possible
variation available in the language. Let's say we want to find all English or French
books. For this, we can use the Add search conditions section:
The complete search expression is generated by combining the search
conditions, a logical AND, and the other criteria entered in the Query by
example lines.
We could have a more complex list of search conditions that would be entered in the
same textbox, possibly with brackets and operators like AND or OR.
A Documentation link points to the MySQL manual, where we can see a huge choice
of available functions. (Each function is applicable to a specific field type.)
Searching Data
[ 158 ]
Obtaining Distinct Results
Sometimes we want to avoid getting the same results more than once. For example,
if we want to know in which cities we have clients, displaying each city name once
is enough. Here we want to know in which languages our books are written.


Pages:
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160