Get the App
SLTechnology News&Howtos  ›  Database  › 

A case study of nested query statements using MySQL

Shulou Source: shulou.com Published: 2022-06-01 20:15:46 10月04日 Update

This article mainly gives you a brief talk about the use of MySQL nested query cases, related professional terms you can check the Internet or find some related books to supplement, here do not dabble in, straight to the topic, hoping to bring you some practical help.

For example:

MySQL nested query statement counts the most populous and least populous cities in each province

SELECT District,NAME,Population FROM city WHERE Population IN (SELECT MIN (Population) FROM city WHERE city.CountryCode='CHN'GROUP BY city.District) UNIONSELECT District,NAME,Population FROM city WHERE Population IN (SELECT MAX (Population) FROM city WHERE city.CountryCode='CHN')

GROUP BY city.District)

The use of MySQL nested query case will first tell you here, for other related issues you want to know can continue to pay attention to the industry information. Our section will capture some industry news and professional knowledge to share with you every day.

Tags: Sentences queries cases specialties industries expertise topics books population content cities actual news terminology plates knowledge information questions Tiandu help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux macOS MySQL Microsoft Shulou Tech Info