This paper is aimed to present a comprehensive survey of relevant research over the period 2012-2021 of Software-Defined Wireless Sensor Network (SDWSN) proposals and Machine Learning (ML) techniques to perform network management, policy enforcement, and network configuration functions. This survey provides helpful information and insights to the scientific and industrial communities, and professional organisations interested in SDWSNs, mainly the current state-of-art, machine learning techniques, and open issues.