SELECT pq.id,
		r.name report,
		p.name printer,
		pqa.name arg,
		pqa.value
	FROM printQueue pq
		JOIN report r ON r.id = pq.reportFk
		JOIN printQueueArgs pqa ON pqa.printQueueFk = pq.id
		LEFT JOIN printer p ON p.id = pq.printerFk
	WHERE r.name = ?
		AND statusCode = 'queued'
	ORDER BY priorityFk ASC
	LIMIT 1