Skip to main content

Is there a way to join two tables using the between operator (SQL). I know I can use SQLCreator but I would like to do this join directly in workbench.

 

sql example: 

TABLE1.*,

TABLE2.*

FROM TABLE1

LEFT JOIN TABLE2

 ON TABLE1.NAME = TABLE2.NAME AND TABLE1.DATE BETWEEN TABLE2.FROM AND TABLE2.TO

Hi ​@stephaniemcphie thanks for your question. I’m not sure you can do the between operation in the FeatureJoiner. I think you might have to use a Tester or TestFilter to select the range after you have joined them with the FeatureJoiner. If you want to do this all in one step then the SQL transformers would be better for this. 
let me know if this helps or if you have further questions! 


For your join clause you can rewrite it to:

ON TABLE1.NAME = TABLE2.NAME
AND TABLE1.DATE >= TABLE2.FROM
AND TABLE1.DATE <= TABLE2.TO

 


Since you don’t want to do it in SQL with an InlineQuerier and do it entirely in workbench transformers, your best bet is the custom transformer FeatureRangeMerger.


Reply