Link to home
Create AccountLog in
Avatar of SuperJinx
SuperJinx

asked on

SQL Inner Join Query - Why is this code not working?

I have two tables, Person and Orders
The primary key in Person is 'Id'  and the primary key in Orders is 'OrderID'

I am trying to join the two tables simply to see which people in Person have orders in Orders

this is my code:

SELECT Person.FirstName, Person.FirstName, Orders.OrderNumber
FROM Person
INNER JOIN Orders
ON Person.Id=Orders.OrderId
ORDER BY Person.FirstName

Thanks!

SuperJinx
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer