Skip to content

Instantly share code, notes, and snippets.

@mlooney
Created September 11, 2009 15:13
Show Gist options
  • Save mlooney/185352 to your computer and use it in GitHub Desktop.
Save mlooney/185352 to your computer and use it in GitHub Desktop.
select o.object_id, o.object_type_id, satr_0.value as name,
satr_5.value as vendor_id, satr_11.value as long_desc, satr_138.value as year from object o
left outer join attr__string_attribute as satr_0
on (satr_0.object_id=o.object_id and satr_0.attribute_id=0)
left outer join attr__string_attribute as satr_5
on (satr_5.object_id=o.object_id and satr_5.attribute_id=5)
left outer join attr__text_attribute as satr_11
on (satr_11.object_id=o.object_id and satr_11.attribute_id=11)
left outer join attr__string_attribute as satr_138
on (satr_138.object_id=o.object_id and satr_138.attribute_id=138)
where o.object_type_id in (1,0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment