Joining 3 tables in SQL Server 2005

5 pts.
Tags:
SQL Query
SQL query optimization
SQL Server
SQL Server 2005
SQL Server Query
SQL tables
Here are the 3 simple SELECT queries i have but i want to merge them all into 1 singl query.

Software/Hardware used:
SQL Server 2005.
ASKED: August 12, 2010  12:37 PM
UPDATED: August 12, 2010  11:17 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

As you didn’t include the tables, I’ll just give you a basic syntax.

<pre>SELECT t1.*, t3.*, t2.col1
FROM t1
JOIN t2 ON t1.col1 = t2.col4
JOIN t3 ON t2.col2 = t3.col1
WHERE t1.Col5 = ‘test’</pre>

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    Your queries didn't get posted.
    65,110 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following