Last active
August 29, 2015 13:56
-
-
Save atopal/9272359 to your computer and use it in GitHub Desktop.
A list of all English KB documents by product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT `wiki_document`.`id`, group_concat(DISTINCT `products_product`.`title` SEPARATOR ', ') as 'products', group_concat(DISTINCT `products_topic`.`title` SEPARATOR ', ') as 'topics', `wiki_document`.`title`, `wiki_revision`.`created` as 'last updated' | |
FROM `wiki_document` | |
JOIN `wiki_document_products` ON `wiki_document_products`.`document_id` = `wiki_document`.`id` | |
JOIN `wiki_document_topics` ON `wiki_document_topics`.`document_id` = `wiki_document`.`id` | |
JOIN `wiki_revision` ON `wiki_revision`.`id`= `wiki_document`.`current_revision_id` | |
JOIN `products_product` ON `products_product`.`id` = `wiki_document_products`.`product_id` | |
JOIN `products_topic` ON `products_topic`.`id` = `wiki_document_topics`.`topic_id` | |
WHERE `wiki_document`.`locale` = "en-US" | |
GROUP BY `wiki_document`.`id` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment