Skip to main content
Question

Select data from one table based on a filed from another table


psprague
Contributor
Forum|alt.badge.img+3

I have two tables. One is a large ODBC table in which I only want to extract the data when the modification date is greater than the last date of another table.

The SQL for what I want to achieve is simple ; SELECT * FROM table1

WHERE modwhen > (SELECT MAX(modwhen1) FROM table2);

Any help is appreciated.

Thank you,

 

 

2 replies

david_r
Evangelist
  • June 12, 2023

A FeatureReader with a corresponding Where-clause would be able to accomplish this. An alternative would be to use the SQLExecutor.


psprague
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • June 13, 2023

What would be the syntax for the second table in the reader of table1? Table1 is an ODBC connection while table2 is a csv. ( 2 readers) . I am able to do it using the InlineQuerier with the following syntax SELECT l1.* from "lwLast" s1, "lwoffs" l1 WHERE l1.modwhen > s1.modwhen1, but I'd really like not to have to process the entire lwoffs table.


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