complicated SQL:how to using a query to compute rank of order(Outstanding of Class 1)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bbaaking
    New Member
    • Apr 2012
    • 19

    #16
    hi Rabbit,
    I googled "having" usage, and I tried this statement:
    select TCID,ID v1, endTime from service group by TCID having v1>20
    It is right. So there must be something wrong with "case when".
    But how to fix it. I have no idea. Can you give me a further hint?

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #17
      In the HAVING clause, you just need to get rid of the CASE statement and use COUNT(*) < 4

      Comment

      Working...