Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 help with INNER JOIN

Author  Topic 

jarv
Posting Yak Master

131 Posts

Posted - 2015-01-19 : 08:33:31
My SQL query is getting an error:

#1054 - Unknown column 'teacher_invoices' in 'on clause'

[code]
SELECT
users.user_id,
users.type,
users.email,
users.firstname,
users.surname,
teacher_invoices.invoice_date,
teacher_invoices.teacher_id
FROM users
INNER JOIN teacher_invoices
ON users.user_id=teacher_invoices=teacher_id
WHERE type = 'teacher' AND teacher_invoices.invoice_date >= '2013-01-01'
[code]

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-01-19 : 08:51:06
Does this look like valid syntax to you:


ON users.user_id=teacher_invoices=teacher_id


?
Go to Top of Page

jarv
Posting Yak Master

131 Posts

Posted - 2015-01-19 : 10:51:23
oh god, silly me, thank you so much... I really need to clean my eyes out
Go to Top of Page
   

- Advertisement -