![](/img/trans.png)
[英]how to select a record from one table and count the number of which appears another table and count it
[英]how to count in one table and get record from another table
我需要以下查詢的幫助 我有 2 個表,第一個位置,主鍵為 no_location,條目 no_membre 和第二個表成員之一,主鍵為 no_membre,條目 prenom_membre 和 nom_membre 我需要知道如何獲取成員的 prenom_membre 和 nom_membre那做了超過25個位置。 先感謝您
使用 HAVING 子句來確定結果集有超過 25 個位置。
SELECT prenom_membre,
nom_membre,
COUNT(no_location)
FROM membre m
JOIN location l
ON m.no_membre = l.no_membre
GROUP BY prenom_membre,
nom_membre
HAVING COUNT(no_location) > 25
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.