Try using MAX
, like this:
SELECT
email,
MAX(`name`)
FROM
(
SELECT
email,
`name`
FROM
multiple_tables_and_unions
) AS emails
GROUP BY email
Related Contents:
- using group_concat in PHPMYADMIN will show the result as [BLOB – 3B]
- Can I concatenate multiple MySQL rows into one field?
- Retrieving the last record in each group – MySQL
- MySQL Query GROUP BY day / month / year
- Error related to only_full_group_by when executing a query in MySql
- Using LIMIT within GROUP BY to get N results per group?
- What does SQL clause “GROUP BY 1” mean?
- SELECT list is not in GROUP BY clause and contains nonaggregated column …. incompatible with sql_mode=only_full_group_by
- MySQL and GROUP_CONCAT() maximum length
- What’s faster, SELECT DISTINCT or GROUP BY in MySQL?
- MySQL order by before group by
- Is it possible to GROUP BY multiple columns using MySQL?
- MySQL DISTINCT on a GROUP_CONCAT()
- GROUP_CONCAT ORDER BY
- MySQL: Sort GROUP_CONCAT values
- GROUP_CONCAT comma separator – MySQL
- How to use GROUP_CONCAT in a CONCAT in MySQL
- Grouping into interval of 5 minutes within a time range
- MySQL “Group By” and “Order By”
- How to group by week in MySQL?
- SQL Query to get column values that correspond with MAX value of another column?
- How to select the first row for each group in MySQL?
- GROUP BY – do not group NULL
- ORDER BY date and time BEFORE GROUP BY name in mysql
- How create json format with group-concat mysql?
- Group by with union mysql select query
- MySQL – Control which row is returned by a group by
- Using ORDER BY and GROUP BY together
- MySQL – Selecting a Column not in Group By
- MySQL joins and COUNT(*) from another table
- GROUP_CONCAT with limit
- Using GROUP_CONCAT on subquery in MySQL
- mysql count group by having
- MySQL Group By and Sum total value of other column
- MySQL: How do I join same table multiple times?
- MySQL Order before Group by
- Group mysql query by 15 min intervals
- MySQL Update query with left join and group by
- MySQL – sum column value(s) based on row from the same table
- MySQL Nested Select Query?
- mysql select sum group by date
- SELECT / GROUP BY – segments of time (10 seconds, 30 seconds, etc)
- How do I concatenate strings from a subquery into a single row in MySQL?
- Select the 3 most recent records where the values of one column are distinct
- Converting SELECT DISTINCT ON queries from Postgresql to MySQL
- How to group by DESC order
- MySQL GROUP_CONCAT with Nulls
- Presto equivalent of MySQL group_concat
- What is the opposite of GROUP_CONCAT in MySQL?
- org.hibernate.AssertionFailure: null id in entry (don’t flush the Session after an exception occurs)