1

Joining two tables together within vb.net but getting the following error:

"Join expression not supported"

SELECT * FROM (General_Counters_Table AS a INNER JOIN Timers_Table AS b ON b.ulProductionTime = a.Product_ID) INNER JOIN Timers_Table AS b ON b.ulSetupTime = a.Product_ID

Product_ID exists in both General_Counters_Table and Timers_Table

0

1 Answer 1

1

The parser got confused when you join for a second time the Timers_Table because you use the same alias already used for the first join.

However it seems that you just want to produce a result with all fields from the A table and some fields from the B table. If this is the case you need to join the two tables with the common field (Product_ID) and add, to the SELECT statement, the fields required from the A and B table

 SELECT a.*, b.ulProductionTime, b.ulSetupTime, ....... 
 FROM General_Counters_Table AS a 
      INNER JOIN Timers_Table AS b ON b.Product_ID = a.Product_ID
Sign up to request clarification or add additional context in comments.

2 Comments

In the Timers_Table - the ulProductionTime and ulSetupTime are on the same row as the matching Timers_Table Product_ID, i just want to join the two columns onto the General_Counters_Table that has the same Product_ID - too be fair there are about 10 columns i want to join to the end, is there a correct way of doing it?
If I understand well your comment then you join just one time and add the required fields to the SELECT statement

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.