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.

Reply via email to