Hi there,
I would like to define and use a variable within my sql command to download some aggregated data from a database. For example I create variable row_num which is used within the “select” statement.
set @row_num=0;
select `Runtime [h]`, Group1, avg(Measure) as avgMeas
FROM (
select
floor((@row_num:=@row_num+1)/3600) AS `Runtime [h]`, Group1, M1 as Measure
from
MyTable
where M1 between 1 and 1000
) as T
group by 1,2
It seems, that KNIME add’s automatically a “SELECT ( * ) FROM (…)” in the background before the command is send to the server. Therefore the definition of the variable “row_num” does not work. Is there a node where I can send unchanged queries to a database?