Created
September 28, 2017 11:59
-
-
Save artygrand/2a3cbcda5cadf76c8c623d037d04dba4 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 entry.id as entry_id, | |
v_brand.value as brand, | |
v_year.value as year | |
FROM entity | |
JOIN entry | |
ON entity.id = entry.entity_id | |
JOIN value v_brand | |
ON v_brand.parameter_id = 1 | |
AND v_brand.entry_id = entry.id | |
JOIN value v_year | |
ON v_year.parameter_id = 2 | |
AND v_year.entry_id = entry.id | |
WHERE entity.name = 'Car' | |
ORDER BY year DESC, brand ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment