Skip to main content
Question

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

  • June 12, 2023
  • 2 replies
  • 41 views

psprague
Contributor
Forum|alt.badge.img+4

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
Celebrity
  • 8392 replies
  • 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+4
  • Author
  • Contributor
  • 4 replies
  • 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.