sql query

  • Thanks,

    RT.

  • Homework?

    Have you tested the query? What is wrong with it?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • It was showing an error and didn't executed!!!

  • What error?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Getting duplicate entries!!

  • No, that's not an error message (and it's not the one that query will throw)

    What error does that query throw?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • what result you are getting with this query and what output you want?

    please provide some more detailed information

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • You might get this error

    "is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause."

    this is because you can select only the columns which are there in the GROUP BY clause.

    Try this

    SELECT AccountID

    FROM Account

    WHERE

    CreateDate > '2/1/2013'

    GROUP BY AccountID

    HAVING

    COUNT(AccountID) >1

  • saravanakumar.G (9/1/2013)


    You might get this error ...

    So much for trying to get someone to figure out their homework for themselves.... He learns nothing by being given the answer.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 9 posts - 1 through 8 (of 8 total)

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