Basic SQL Query

  • hi,

    I new to sql server.Below is the query I am writing.On running this query the error is

    'Incorrect syntax near the keyword 'where'.Let me know the correct syntax to run this query successfully.

    select s.applicationargumentid,a.applicationargument,s.urlid,u.url,s.domainid,d.domain

    from stats s,idomain d,iapplicationargument a,iurl u

    where (s.domainid = d.domainid) and

    (s.applicationargumentid = a.applicationargumentid) and

    (s.urlid = u.urlid)

    where s.requestdate = '2008-07-30'

  • Blazix Marler (7/6/2009)


    hi,

    I new to sql server.Below is the query I am writing.On running this query the error is

    'Incorrect syntax near the keyword 'where'.Let me know the correct syntax to run this query successfully.

    select s.applicationargumentid,a.applicationargument,s.urlid,u.url,s.domainid,d.domain

    from stats s,idomain d,iapplicationargument a,iurl u

    where (s.domainid = d.domainid) and

    (s.applicationargumentid = a.applicationargumentid) and

    (s.urlid = u.urlid)

    where s.requestdate = '2008-07-30'

    select s.applicationargumentid,a.applicationargument,s.urlid,u.url,s.domainid,d.domain

    from stats s,idomain d,iapplicationargument a,iurl u

    where (s.domainid = d.domainid) and

    (s.applicationargumentid = a.applicationargumentid) and

    (s.urlid = u.urlid)

    AND s.requestdate = '2008-07-30'

    There was 2 'where' clauses in the select statement leading to error.



    Pradeep Singh

  • thanks for immediate reply.I got it just now

  • Glad you got it going.

    Please go through this site as this will help you to post relevent details in the thread that will help others to help you in a better way.

    http://www.sqlservercentral.com/articles/Best+Practices/61537/



    Pradeep Singh

Viewing 4 posts - 1 through 3 (of 3 total)

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