Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2010
    Posts
    2

    Unanswered: SQL query request

    Hi all,

    First post here, I have the following query:

    1> select ExtractorId from dmLC_FAILQUEUE
    2> go
    ExtractorId
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    EXTR_GCD_PROD
    EXTR_GCD_PROD
    EXTR_GCD_PROD
    EXTR_GCD_PROD
    EXTR_LDN_PROD
    EXTR_LDN_PROD
    EXTR_LDN_PROD
    EXTR_LDN_PROD
    EXTR_NY_PROD
    EXTR_NY_PROD
    EXTR_NY_PROD
    EXTR_SNG_PROD


    I've been trying to develop a subquery that allows me to count the number of times every different ExtractorId appears in the query (for example EXTR_GCD_PROD 4, EXTR_LDN_PROD 4, EXTR_NY_PROD 3, etc) but no luck so far. Any ideas how this could be done?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    use COUNT(*) with GROUP BY
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Dec 2010
    Posts
    2
    Thanks very much!

Posting Permissions

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