如何一條SQL從一張表中取出關聯字段值分別為A/B/C的資料一個取出N條?
自問自答
SELECT * FROM s_area AS a WHERE area_parent_id in (3,4,5) and 5 > ( SELECT COUNT(*) FROM s_area WHERE area_parent_id = a.area_parent_id AND area_id>a.area_id) order by area_sort asc
自問自答