Created
December 9, 2016 16:05
-
-
Save Dobby89/841ee1889c406d47f096180d7f666658 to your computer and use it in GitHub Desktop.
SQL Query with Concat and Group Concat
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 | |
p.product_id, | |
pd.name, | |
pd.description, | |
pd.title_tag AS meta_title, | |
pd.meta_keywords, | |
pd.meta_description, | |
CONCAT('http://www.domain.co.uk/', u.keyword) AS URL, | |
GROUP_CONCAT(pt.tag) AS tags, | |
p.status | |
FROM | |
product AS p | |
Left Join product_description AS pd ON pd.product_id = p.product_id | |
Left Join url_alias AS u ON u.query = CONCAT('product_id=',p.product_id) | |
Left Join product_tags AS pt ON pt.product_id = p.product_id | |
GROUP BY p.product_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment