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 PROJECTFROM 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.|||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.|||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.|||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|||thank u rajesh.im familiar with sql's(DDLS and DMLS).please guide me to the correct query for the above one.|||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.
No comments:
Post a Comment