Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004

    Unanswered: Concatenating multiple returns on one field only

    I have a SQL query that returns several fields from several tables, eg. Title, Subtitle, Author, Binding and Imprint. When these are returned everything seems rosy until there are two authors linked to one title. When this happens Title, Subtitle, Binding and Imprint are repeated which is not required. Is there a way to concatenate the authors from multple records to return a single title with the concatenated authors, instead of repeating titles due to multiple authors?.

    A query may currently return:
    Title1 - Subtitle1 - Author 1a - etc
    Title1 - Subtitle1 - Author 1b - etc
    Title1 - Subtitle1 - Author 1c - etc
    Title2 - Subtitle2 - Author 2a - etc
    Title3 - Subtitle3 - Author 3a - etc

    When I would like
    Title1 - Subtitle1 - Author 1a, Author 1b, Author 1c - etc
    Title2 - Subtitle2 - Author 2a - etc
    Title3 - Subtitle3 - Author 3a - etc

    My actual SQL code, if you are interested, is:

    SELECT dbo.edition.ISBN, dbo.edition.title,' ' as name,, dbo.edition.long_blurb, dbo.series.series_id, dbo.series.series_number,
    dbo.series.series_title, dbo.edition.sub_title, dbo.edition.about_author, dbo.edition.short_blurb,
    dbo.series.editors_affiliations, dbo.title.contents, dbo.title.affiliations, dbo.series.series_editors
    FROM dbo.edition INNER JOIN
    dbo.series ON dbo.edition.series_id = dbo.series.series_id INNER JOIN
    dbo.title ON dbo.edition.title_id = dbo.title.title_id INNER JOIN
    dbo.agreement ON dbo.edition.edition_id = dbo.agreement.edition_id INNER JOIN
    dbo.role ON dbo.agreement.role_id = dbo.role.role_id INNER JOIN ON dbo.role.party_id =

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    You could use a simple variant on fGlue() to do this.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts