
		SELECT
			automated, discussion,
			COUNT(*) AS the_count,
			UNIX_TIMESTAMP(last_draft_submitted) AS last_draft_ts,
			first_draft_submitted, partial_draft_submitted, unread_messages, open_followups
		FROM message, discussion
		WHERE message.discussion = discussion.id
		AND message.project = 12037
		AND discussion.status = 'Client'
		GROUP BY discussion, automated
		ORDER BY CAST(automated AS char) DESC
	