• Raxter (2/10/2016)


    Original data

    AppIDBreedage

    101Pitbull2

    102Boxer4

    103Pitbull1

    104Pitbull5

    105Boxer2

    106Pitbull2

    107Boxer8

    108Pitbull1

    109Pitbull3

    110Boxer8

    Expected output

    AppIDBreedage

    101Pitbull2

    102Boxer4

    103Pitbull1

    104Pitbull5

    105Boxer2

    106Pitbull2

    107Boxer8

    108Pitbull1

    109Boxer 3

    110Boxer8

    This raises more questions.

    Your example has 2 breeds. What happens when there are more?

    How do you relate Pitbulls to Boxers? Or any one breed to another?

    What do you do when it is not a multiple of 5? What happens when you have 4 Boxers and 4 Pitbulls?

    What is the purpose of age if the name of the breed changes?

    How is AppID used? Can you just change the label of what it is pointing to without ramifications to other tables?

    Is it possible to re-think the design?

    __________________________________________________________________________________________________________
    How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/