Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is wrong with this query?

Status
Not open for further replies.

bousair

Technical User
Jan 16, 2002
5
NL
Hello everybody,

What is wrong with this query?

SELECT * FROM data_vault.hub_artikelnummer art

INNER JOIN (SELECT *
FROM data_vault.sat_artikel_1
WHERE hub_artikelnummer_sqn = art.sqn) aap ON sart1.load_datetime = aap.ldt AND art.sqn = 500

I am getting the following error:

Unknown column 'art.sqn' in 'where clause'

Thank you.
 
Code:
SELECT * 
  FROM data_vault.hub_artikelnummer AS art
INNER 
  JOIN data_vault.sat_artikel_1 AS aap 
    ON aap.hub_artikelnummer_sqn = art.sqn
   AND aap.ldt = art.load_datetime
 WHERE art.sqn = 500

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top