Created
August 9, 2012 14:36
-
-
Save laod/3304707 to your computer and use it in GitHub Desktop.
We don't need no steenking pivot
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
create temp view tv2 as select | |
b.did as id, | |
(select a.value from namevalue as a where a.name='first' and | |
a.did=b.did) as first, | |
(select a.value from namevalue as a where a.name='last' and | |
a.did=b.did) as last, | |
(select a.value from namevalue as a where a.name='uid' and | |
a.did=b.did) as uid, | |
(select a.value from namevalue as a where a.name='displayname' and | |
a.did=b.did) as displayname, | |
(select lower(a.value) from namevalue as a where a.name='displayname' and | |
a.did=b.did) as lowername | |
from | |
(select did from namevalue group by did) as b ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment