Jump to content

SQL Join


vkhare

Recommended Posts

Hi, Below is the example query given for SQL Join in w3school. SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDateFROM OrdersINNER JOIN CustomersON Orders.CustomerID=Customers.CustomerID; however i have done some minor tweaking in above query but the o/p is totally different in my case. also taking long time to give o/p. please let me know where i am wrong. below is the query which i am using . SELECT o.OrderID, c.CustomerName, o.OrderDateFROM Orders as o, customers as cINNER JOIN CustomersON o.CustomerID=c.CustomerID;

Link to comment
Share on other sites

Try this:

SELECT o.OrderID, c.CustomerName, o.OrderDate, c.CustomerIDFROM Orders as oINNER JOIN Customers as cON o.CustomerID=c.CustomerID;
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...