Here are some hints... ...they might help.
I struggled with joins a few days ago. ( finally had the DB solve it, not WF )
Problem is... ...what WF calls a join... isn't.
It decides wether to do the join based on the query.
Any other SQL would do the join first...
You can force WF to do the join by selecting fields from both masters.
You have JOIN as statement. I think that's a CROSS join ( full other join ).
Try some of the join-options.
I had this ( both DB files )
LEFT JOIN x in A to x in B
WHERE A.y = B.y
Turns out the WHERE is only excuted at query level.
e.g.
TABLE FILE A
PRINT A.x
END
shows all lines from A regardless of the WHERE in the join-statement.
TABLE FILE A
PRINT A.x B.x
END
shows only lines with the WHERE applied.
____________________________________
I came around this. Very useful. ( if performance of reportingserver suffices )
You can actually write your own SQL to HOLD files.
SET ASNAMES = ON
TABLE FILE CAR
SUM SALES
BY CAR
ON TABLE HOLD AS FOC_CAR
END
TABLE FILE CAR
SUM MIN.SEATS AS LSEATS
MAX.SEATS AS HSEATS
BY CAR
ON TABLE HOLD AS FOC_SEATS
END
-* join
SQL
SELECT
FOC_CAR.CAR , SALES , LSEATS , HSEATS
FROM FOC_CAR
INNER JOIN FOC_SEATS
ON FOC_CAR.CAR = FOC_SEATS.CAR;
TABLE HOLD AS BLACKBOX
END
-* even insert works..
SQL
insert into BLACKBOX ( CAR , SALES, LSEATS, HSEATS ) VALUES ( 'TESLA' , 80000, 2 , 4 );
-*TABLE ON TABLE HOLD AS H_CAR2
END
-RUN
TABLE FILE BLACKBOX
PRINT *
END
Good luck,
Dave
_____________________
WF: 8.0.0.9 > going 8.2.0.5