Created
December 12, 2015 23:09
-
-
Save q1x/2eeec1ef237cd3c637a1 to your computer and use it in GitHub Desktop.
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 item.title,year.attribute_val,item.s_item_type,GROUP_CONCAT(item_attribute.lookup_attribute_val SEPARATOR ', '),DATE(item_instance.update_on) INTO OUTFILE '/tmp/opendb_export.csv' FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' FROM item LEFT JOIN item_instance ON item.id=item_instance.item_id LEFT JOIN item_attribute ON item.id=item_attribute.item_id LEFT JOIN (SELECT item_id,attribute_val FROM item_attribute WHERE s_attribute_type="YEAR") year on item.id=year.item_id WHERE (item.s_item_type="DVD" AND item_attribute.s_attribute_type="DVD_REGION") OR (item.s_item_type="BLU-RAY" AND item_attribute.s_attribute_type="BD-REGION") GROUP BY item_attribute.item_id ORDER BY item_instance.update_on ASC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment