Knime H2 query DISTINCT ON problem

Hi,

I have problem with query DISTINCT ON in H2.

I am using H2 connector (in-memory).

My test table looks like

My query using DB Query

SELECT DISTINCT ON (“Product”) * FROM #table# “t1” ORDER BY “Product”, “Date” DESC;

But I get error

The result of my query should be
20230612_104621

Thanks in advace for help.

Hi,
It works for me like this:

SELECT DISTINCT ON (t1."Product") * FROM #table# t1 ORDER BY t1."Product", t1."Date" DESC;

Kind regards,
Alexander

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.