Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2006
    Posts
    83

    Question Unanswered: incorrect syntax near LEFT

    this is the query im trying to execute in sql server.please let me know what is the error in this



    SELECT "PROJECT"."PROJ_NAM", ' ' as dev_name, "PROJECT_FUND"."F_FUND_ID" as fund_id, view_on_watch_list.on_date
    FROM LEFT OUTER JOIN view_on_watch_list ON project.proj_id =view_on_watch_list.proj_id , "PROJECT_FUND" LEFT OUTER JOIN "FUND" ON "PROJECT_FUND"."F_FUND_ID" = "FUND"."FUND_ID" AND project.proj_id = project_fund.f_proj_id , "PROJECT" WHERE (("PROJECT"."PROJ_ID" = 1))
    select "PROJECT"."PROJ_ID", ' ' AS DEV_TYPE from PROJECT
    Last edited by krReddy; 10-05-06 at 10:22.

  2. #2
    Join Date
    Jan 2006
    Location
    USA
    Posts
    115
    FROM LEFT OUTER JOIN
    Enter Table_Name after "FROM" clause...

    project.proj_id = project_fund.f_proj_id , "PROJECT" WHERE (("PROJECT"."PROJ_ID" = @proj_id))
    select "PROJECT"."PROJ_ID", ' ' AS DEV_TYPE from PROJECT
    I didn't get what you want to do... Post your table structure, data & your requirement.
    Rajesh Patel

    Everybody says - mistake is the first step of success, but it's not true. The correction of the mistake is the first step of success.

  3. #3
    Join Date
    Oct 2006
    Posts
    83
    actually im a beginner in MSSQL.im not aware of this LEFT OUTER JOIN syntax.
    i tried with placing table name after 'LEFT' ,below error was thrown

    [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Tables or functions 'project' and 'PROJECT' have the same exposed names. Use correlation names to distinguish them.

  4. #4
    Join Date
    Jan 2006
    Location
    USA
    Posts
    115
    Wel Come

    Before you use query in application code, run & check it using SQL Query Analyzer.

    Develop query step by step i.e. don't write entire query at once but create 1st then 2nd phrase etc...

    Spend some time to learn, you can refer SELECT syntax in Books OnLine from SQL Query Analyzer.
    Rajesh Patel

    Everybody says - mistake is the first step of success, but it's not true. The correction of the mistake is the first step of success.

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    If you are just starting you might find this a gentler learning curve:
    http://www.w3schools.com/sql/sql_intro.asp

    rajeshpatel is spot on - don't write out loads at once - write a small section, run, if it works write some more else refer to the link and correct.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    Oct 2006
    Posts
    83
    thank u rajesh.im familiar with sql's(DDLS and DMLS).please guide me to the correct query for the above one.

  7. #7
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I'm afraid the SQL is so bad it is not possible to tell what you want you want to do. I strongly recommend you read the link and have another stab at writing it. As you come up against problems get back to us with specifics.

    If you build up a bit at a time it might be possible to infer what you are actually attempting to do.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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