Guest User

Untitled

a guest
May 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. select av.object_id,amt.text as wwocs_id
  2. ,(select amt1.text from ams_texts amt1 where amt1.value_id = (select av1.value_id from ams_attribute_values av1
  3. where av1.object_id = av.object_id
  4. and av1.attribute_id = (select attribute_id from ams_attributes where attribute_name = 'first_names'))) as first_names
  5. ,(select amt1.text from ams_texts amt1 where amt1.value_id = (select av1.value_id from ams_attribute_values av1
  6. where av1.object_id = av.object_id
  7. and av1.attribute_id = (select attribute_id from ams_attributes where attribute_name = 'last_name'))) as last_name
  8. ,(select amt1.text from ams_texts amt1 where amt1.value_id = (select av1.value_id from ams_attribute_values av1
  9. where av1.object_id = av.object_id
  10. and av1.attribute_id = (select attribute_id from ams_attributes where attribute_name = 'attendee_email'))) as attendee_email
  11.  
  12. from ams_attribute_values av inner join ams_texts amt on av.value_id=amt.value_id
  13. where av.attribute_id=(select attribute_id from ams_attributes where attribute_name = 'client_wwocs')
  14. and ((select count(*) from ams_attribute_values av1 inner join ams_texts amt1 on av1.value_id=amt1.value_id where amt1.text=amt.text and av1.attribute_id=av.attribute_id)) > 1
  15. order by wwocs_id,last_name
Add Comment
Please, Sign In to add comment