我有contacts
具有id | city_id | category_id |電子郵件字段的表。
基本的查詢是mysqli:爲IN ID中的每一個選擇查詢和限制
"
SELECT id
, email
FROM contacts
WHERE city_id IN (".implode(',', $arrCity).")
AND category_id IN (".implode(',', $arrCategory).")
"
但我需要設置一個限制:10排在城市的各個類別。可能嗎?
請參閱https://meta.stackoverflow.com/questions/333952/why-should-i-provide-an-mcve-for-what-seems-to-me-to-be-a-very-simple- sql-query – Strawberry