Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select av.object_id,amt.text as wwocs_id
- ,(select amt1.text from ams_texts amt1 where amt1.value_id = (select av1.value_id from ams_attribute_values av1
- where av1.object_id = av.object_id
- and av1.attribute_id = (select attribute_id from ams_attributes where attribute_name = 'first_names'))) as first_names
- ,(select amt1.text from ams_texts amt1 where amt1.value_id = (select av1.value_id from ams_attribute_values av1
- where av1.object_id = av.object_id
- and av1.attribute_id = (select attribute_id from ams_attributes where attribute_name = 'last_name'))) as last_name
- ,(select amt1.text from ams_texts amt1 where amt1.value_id = (select av1.value_id from ams_attribute_values av1
- where av1.object_id = av.object_id
- and av1.attribute_id = (select attribute_id from ams_attributes where attribute_name = 'attendee_email'))) as attendee_email
- from ams_attribute_values av inner join ams_texts amt on av.value_id=amt.value_id
- where av.attribute_id=(select attribute_id from ams_attributes where attribute_name = 'client_wwocs')
- 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
- order by wwocs_id,last_name
Add Comment
Please, Sign In to add comment