Hello folks,
i need help implementing the in operator in a ce_projection:
so this is what i want to do with only using CE Functions:
SELECT "a","b" from table WHERE "b" = (
SELECT MIN ("b") FROM table
);
so far i got this:
temp1 = CE_COLUMN_TABLE("Schema"."project.data::table1", ["a", "b", "c", "d"]);
temp2 = CE_AGGREGATION(:temp1, [MIN("b")]);
temp3 = CE_PROJECTION(:temp2, ["a", "b"], '"b" = :temp2');
This of course will not work, since temp2 is a whole result set (with rowcount only being 1) but still, this wont work.
in this discusstion 'IN' Operator in CE_PROJECTION i found a possibility for the IN operator
according to that, temp3 would be:
temp3 = CE_PROJECTION(:temp2, ["a", "b"], 'in("b", '':temp2'')');
the in clause from the post above works just fine, where COL1 is being compared to a,b,c characters
var_out = CE_PROJECTION (:lt_test_n, ["COL1", "COL2"], ' in("COL1",''A'',''B'',''C'');
any thoughts? or other ways to solve this?
i mean i could just do a
declare temp4 int;
select "b" into temp4 from :temp2
temp3 = CE_PROJECTION(:temp2, ["a", "b"], '"b" = :temp4);
but then i am going to the sql optimizer again. i would like to do this with CE functions alone.
Thanks for any help and ideas
Chris