Solved

sql server, database

Posted on 2011-09-07
3
213 Views
Last Modified: 2012-05-12
I need to join 3 tables A, B, C  inner join A and B on ID and some other conditions. Then the result should be joined with C on the same id . but with C its a left outer join on the id. any suggestions?
0
Comment
Question by:singsunn
3 Comments
 
LVL 40

Expert Comment

by:Sharath
ID: 36497771

try this.
select *
  from A
  join B on A.id = B.id -- add your other conditions
  left join C on A.id = C.id

Open in new window

0
 
LVL 51

Expert Comment

by:HainKurt
ID: 36497953
maybe this

select * from
(
select a.*, b.some other columns from a inner join b on a.id=b.id and ...
) x left join c on x.id=c.id
0
 
LVL 32

Accepted Solution

by:
ewangoya earned 500 total points
ID: 36499843

select *
from A
inner join B on A.id = B.id
left join C on C.id = B.id
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now