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
 Inner join HELP!
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Crima
Starting Member

USA
17 Posts

Posted - 10/18/2012 :  16:09:46  Show Profile  Reply with Quote
I've been trying to figure out this problem

Write a SELECT statement that returns all columns from the Vendors table inner-joined with the
Invoices table.

so far i've gotten

SELECT * FROM Vendors
INNER JOIN Invoices
ON Vendor.VendorID = Invoice.VendorID


but it's not liking Vendor.VendorID = Invoice.VendorID
I don't know another way since this is the only way they're related.

Any help helps!

A witty student

mandm
Yak Posting Veteran

53 Posts

Posted - 10/18/2012 :  16:19:53  Show Profile  Reply with Quote
If your table names are Vendors and Invoices then your table references need to match in the ON condition. i.e. Invoices.VendorID = Vendors.VendorID
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 10/18/2012 :  16:20:20  Show Profile  Reply with Quote
what do you mean its not liking Vendor.VendorID = Invoice.VendorID?

can you elaborate with some sample data?


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Crima
Starting Member

USA
17 Posts

Posted - 10/18/2012 :  17:01:29  Show Profile  Reply with Quote
I just figured it out. Supposed to be "Vendors" instead of Vendor, same with Invoices

-________________- Always a little mistake that drives me nutts.

A witty student
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.03 seconds. Powered By: Snitz Forums 2000