Not displaying 'double' information - way to group

  • I've question about the filtering of results of a query

    Image Query.png shows the query

    Image Results.pngshows the results of the query

    Image Wannahave.png shows how I like to have this

    Explanation (this example):

    Data from two databases are combined and give result (or NULL if not exists)

    Because there are 3 results for Description, Status and Score (PURPLE), the results for Customer, Contract, Component_Value (BLUE) are repeated.

    I'dd like the results where Component Value is summed (added together), but only for the 4 original value's and not for all the component values because everything is tripled.

    I've tried several things, but no luck.

    Can somebody give me a hand?

  • Please post table definitions, sample data and desired output. Read this to see the best way to post this to get quick responses.

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    It would be far more useful if you could post the info as text, not images. I can't copy the query from an image to modify it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply