SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Join question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Inno
Starting Member

33 Posts

Posted - 11/22/2006 :  09:42:03  Show Profile  Reply with Quote
Can I make a join on two columns?

I have two tables with columns

Number, ArtNo, Ware

There is just one row in each table for each combination of ArtNo and ware. And I want for each combination see if Number is the same value

X002548
Not Just a Number

15586 Posts

Posted - 11/22/2006 :  09:50:56  Show Profile  Reply with Quote
You sure about that? DDL and sample data would help...read the hint link in my sig...BUT

SELECT l.ArtNo, l.Ware, l.Number, r.Number
FROM table1 l join table 2 r
ON l.ArtNo = r.ArtNo AND l.Ware = r.Ware



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22765 Posts

Posted - 11/22/2006 :  11:32:20  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Also Learn SQL

http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000