Consulting

Results 1 to 1 of 1

Thread: Count unique instances of a column in relation to another column?

  1. #1
    VBAX Regular
    Joined
    Sep 2011
    Posts
    16
    Location

    Count unique instances of a column in relation to another column?

    Using SSMS 2008 to query SQL Server 2005 -
    I have a table with data that is similar to below:

    A B C
    1 11 111
    2 11 111
    3 11 112
    4 11 112
    5 12 113
    6 12 113
    7 12 113
    8 12 113
    9 13 114
    10 13 114

    As you can see, the first column is unique, the second column refers to the created instance, and the third column refers to the order that falls against the number in column B.

    I would like to create a SQL query that would allow me to pull all numbers from column B that have more than one number in C assigned to it. In the above example it would be number '11' in row B because it has numbers '111' and '112' from column C in it.



    Edit: Added some info
    Last edited by JGalper; 08-17-2012 at 10:18 AM.

Posting Permissions

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