Unique Item

  • SSN | ID | Status_ID |

    -----------------------------------------

    131764 | 1 | 120 |

    131764 | 2 | 40 |

    131764 | 3 | 50 |

    131764 | 4 | 60 |

    122154 | 6 | 10 |

    122154 | 7 | 40 |

    Above is a sample table. We need to do a Select statement that gets a count of unique

    ssn which has a status_id of 60. As in the above example, the count would only be 1, since the

    status_id of 60 is existing for ssn = 131764.

  • Something like this

    SELECT COUNT(DISTINCT SSN) FROM myTbl WHERE Status_ID = 60

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

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

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