Databases Reference
In-Depth Information
The complete search expression is generated by combining the search
conditions and other criteria (entered in the
query
by
example
lines)
with a logical
AND
operator.
We could have a more complex list of search conditions that would be entered in the
same textbox, possibly with brackets and operators such as
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 column type.)
Avoiding repeated results
The normal behavior of the
SELECT
statement is to fetch all entries corresponding
to the criteria, even if some entries are repeated. Sometimes, we may 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 would be enough. Here, we
want to know in which languages our topics are written. In the
Select
columns
dialog, we choose just the
language
column, and we check
DISTINCT
, as shown in
the following screenshot:
Clicking on
Go
produces a results page where we see
en
just once; without the
DISTINCT
option, the row containing
en
would have appeared three times.
If we select more than one column (for example
author_id
and
language
) and mark
the
DISTINCT
option, we will now see two lines in the results as there are two topics
in English (but from different authors). Results are still not repeated.
Search WWH ::
Custom Search