doubt in query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • solvemyqueries
    New Member
    • Nov 2008
    • 1

    doubt in query

    hi friends.

    i had to execute this query,but it post a error saying"its not a group function"

    The query is "select name,count(trai ningdates) from tablenames group by having count(trainingd ates)<=5 and tablename.train erid=tablename. trainerid

    i need to compare the count function and join query using where clause,can any body help me please
  • Pilgrim333
    New Member
    • Oct 2008
    • 127

    #2
    Hi,

    Your query should be:

    Code:
    select name,count(trainingdates) 
    from   tablenames 
    group by name having count(trainingdates)<=5 and   
                         tablename.trainerid=tablename.trainerid
    Your output contains the column name, and a count. Name should be in your group by clause.

    Pilgrim.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      as suggested in the previous post you need a field to group by ,which is missing in your query.

      Comment

      Working...