Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6880651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:00:04+00:00 2026-05-27T05:00:04+00:00

In SQL Server, I am joining three tables like below. select t1.empid, t2.sales, t3.date

  • 0

In SQL Server, I am joining three tables like below.

select t1.empid, t2.sales, t3.date
from table1 t1
left outer join table2 t2 on t1.empid = t2.empid
left outer join table3 t3 on t1.empid = t2.empid 
   and t2.id= t3.id

Is this correct, I use and condition, thank you.

if i write the proc: i am joing the table using left outer join

select wrh.empid
from Tbl_F_Weekly_Report_Header WRH
left outer join Tbl_Emp_Master_M EM on wrh.EmpId =em.EmpId
LEFT outer join Tbl_F_Emp_Position_M EPS on WRH.PositionCode = EPS.PositionCode 
where EM [Tbl_Emp_Master_M] doesnot contain Positioncode

is it correct

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:00:05+00:00Added an answer on May 27, 2026 at 5:00 am

    Your LEFT OUTER JOIN on table3 is incorrect. You just need:

    SELECT t1.empid, t2.sales, t3.date
    FROM table1 AS t1
    LEFT OUTER JOIN table2 AS t2 ON t1.empid = t2.empid
    LEFT OUTER JOIN table3 AS t3 ON t2.id = t3.id 
    

    since you have already specified t1.empid = t2.empid above in the first LEFT OUTER JOIN

    Your updated query:

    SELECT wrh.empid
    FROM Tbl_F_Weekly_Report_Header AS wrh
    LEFT OUTER JOIN Tbl_Emp_Master_M AS em ON wrh.EmpId = em.EmpId     
    LEFT OUTER JOIN Tbl_F_Emp_Position_M AS eps ON wrh.PositionCode = eps.PositionCode
    

    looks good, just make sure you include FROM (was originally missing from your question)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the recommended way of joining SQL Server database tables located on databases
I have these tables (in SQL-Server 2008 R2): Table1: Id Guid 1 {530D8FE1-7541-43CC-9F92-1AA776490155} 2
I have a very simple select on SQL Server: select * from person where
SQL Server 2000 Standard, Windows 2003 My coworker removed 'BUILTIN\Administrators' group from SQL Server
SQL Server (2005/2008) Each of the below statements have the same result. Does anyone
Sql Server Management Studio 2008 is not scripting table permissions even when I select
I have a couple of tables that are joined by GUIDs in SQL Server.
I need to filter result sets from sql server based on selections from a
I'm trying to make a select statement that joins results from three in-line table
Our SQL Server 2005 database has nearly 100 different tables. We are going to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.