Skip to content

Query Subscriptions without Monitor

Remco Tolsma edited this page Oct 1, 2016 · 3 revisions
SELECT
	product.name,
	subscription.name
FROM
	orbis_subscriptions AS subscription
		LEFT JOIN
	orbis_subscription_types AS product
			ON subscription.type_id = product.id
WHERE
	subscription.cancel_date IS NULL
		AND
	subscription.name NOT IN (
		SELECT
			post_title
		FROM
			wp_posts
		WHERE
			post_type = 'orbis_monitor'
	)
		AND
	(
		product.name LIKE '%WordPress onderhoud en support%'
			OR
		product.name LIKE '%Hosting%'
	)
;

Clone this wiki locally