Skip to main content
Question

Feature Joiner using Between operator

  • December 24, 2024
  • 3 replies
  • 41 views

stephaniemcphie
Contributor
Forum|alt.badge.img+2

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

3 replies

evieatsafe
Safer
  • Safer
  • December 27, 2024

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! 


hkingsbury
Celebrity
Forum|alt.badge.img+55
  • Celebrity
  • January 5, 2025

For your join clause you can rewrite it to:

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

 


ctredinnick
Supporter
Forum|alt.badge.img+19
  • Supporter
  • January 6, 2025

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings