MySQL Tutorials
Miscellany
No matter how well things are, we adjust our desires to be unhappy.
MySQL Tips
Below is a quick tips related to the topic of this page. It has been randomly selected from a database containing several. Refresh this page to see another.
Grouping & Ordering
If you need to use GROUP BY for some reason (e.g., to use COUNT(*)), but you want to use ORDER BY to sort the results based a different column, set up a sub-query:
SELECT
CONCAT(name_first, ' ', name_last)
AS Client,
orders AS 'Total Orders'
FROM
(SELECT COUNT(*) AS orders,
name_first, name_last
FROM client_orders
GROUP BY name_last)
AS order_counts
ORDER BY name_first;

Article Search
Use this page to search my articles based on a keyword. You can also limit the articles searched to specific categories. Additionally, since many of my articles are about MySQL, you can search my documentation of MySQL. Just checked or uncheck the categories and documentation you want or don't want.
Number of Articles and Documents Found