Thanks for the quick replies! Tom's solution is nice because you can specify the handles instead of the internal IDs. I thought I was going to have to figure out which collections each the community had, but it's simpler to just list them since there are only ten or so.
Thanks again, On Thu, Sep 29, 2016 at 4:27 PM, Tom Desair <[email protected]> wrote: > If you do not want to relay on the owning collection and use the > collection handle, you can do this: > > select distinct text_value > from metadatavalue > where metadata_field_id = (select metadata_field_id from > metadatafieldregistry where element = 'contributor' and qualifier = 'author') > AND resource_type_id = 2 AND > resource_id IN (select item_id from collection2item where collection_id > IN > (select > resource_id from handle where handle in ('123456789/3', '123456789/4'))); > > > > [image: logo] Tom Desair > 250-B Suite 3A, Lucius Gordon Drive, West Henrietta, NY 14586 > Esperantolaan 4, Heverlee 3001, Belgium > www.atmire.com > <http://atmire.com/website/?q=services&utm_source=emailfooter&utm_medium=email&utm_campaign=tomdesair> > > 2016-09-29 15:24 GMT+02:00 Sean Carte <[email protected]>: > >> >> >> On 29 September 2016 at 15:12, Alan Orth <[email protected]> wrote: >> >>> Hi, >>> >>> I want to generate a list of authors in a certain community and its >>> collections. My goal is to do some batch cleanups of the names. >>> Normally I just select all the distinct text_value fields for the >>> metadata field I'm interested in, like here for 3 >>> (dc.contributor.author): >>> >>> dspace=# select distinct text_value from metadatavalue where >>> resource_type_id=2 and metadata_field_id=3; >>> >>> But I don't understand DSpace's database schema well enough to limit >>> that to a certain community and its collections. >>> >>> Can anyone help? This is DSpace 5 + PostgreSQL. >>> >> >> Hi Alan >> >> How about something like this: >> >> SELECT i.item_id AS item_id, i.owning_collection AS collection, >> d.text_value AS date, a.text_value AS author >> FROM metadatavalue d, metadatavalue a, item i >> WHERE d.resource_id = a.resource_id AND d.resource_id = i.item_id >> AND i.discoverable = 't' AND i.in_archive = 't' AND i.withdrawn = 'f' >> AND d.metadata_field_id = 11 >> AND a.metadata_field_id = 3 >> AND d.text_value >= '2016-01' AND d.text_value < '2016-10' >> AND i.owning_collection = 11; >> >> Sean >> -- >> >> -- >> You received this message because you are subscribed to the Google Groups >> "DSpace Technical Support" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at https://groups.google.com/group/dspace-tech. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "DSpace Technical Support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/dspace-tech. > For more options, visit https://groups.google.com/d/optout. > -- Alan Orth [email protected] https://englishbulgaria.net https://alaninkenya.org https://mjanja.ch "In heaven all the interesting people are missing." ―Friedrich Nietzsche GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0 -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.
