Results 1 to 2 of 2

Thread: leat outer join

  1. #1
    Join Date
    Oct 2006
    Posts
    83

    Question Unanswered: leat outer join

    is it possible to execute a query which uses "left outer join" without specifying alias names for table names .
    im trying to execute a query which uses left outer join.
    SELECT
    PROJECT.PROJ_NAM,
    ' ' as dev_name,
    FUND.FUND_NAME as fund_name,
    PROJECT_FUND.F_FUND_ID as fund_id,
    ' ' as dev_proper,
    view_on_watch_list.on_date
    FROM PROJECT 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


    but error message thrown was
    [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The column prefix 'project' does not match with a table name or alias name used in the query.

    kindly suggest me

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    try like this --
    Code:
    select project.proj_nam
         , ' ' as dev_name
         , fund.fund_name as fund_name
         , project_fund.f_fund_id as fund_id
         , ' ' as dev_proper
         , view_on_watch_list.on_date
      from project 
    left outer
      join project_fund 
        on project_fund.f_proj_id = project.proj_id
    left outer
      join fund 
        on fund.fund_id = project_fund.f_fund_id 
    left outer 
      join view_on_watch_list 
        on view_on_watch_list.proj_id = project.proj_id
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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