Solved

sql server, database

Posted on 2011-09-07
3
214 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PK numbers not follow 8 60
SQL Server Select on LT running Totals 6 63
How to print the sql query 18 49
Another way of doing this SQL 8 46
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 …
There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

929 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

13 Experts available now in Live!

Get 1:1 Help Now