I have one table with number_ID, and second with orders and I want to display sum of orders by number_ID
Can someone know how write sql query ?
use the “GroupBy”-Node and configure Number_ID as “Group column” and under “Manual Aggregation” define Orders as column and “sum” as Aggregation.
That will give you the sum of Orders for each Number_ID.
Hi there @pjacob,
sql query syntax depends on database so a bit tricky to answer and not really a KNIME question. If you were wondering which node to use in order to write custom sql query you can try DB Query Reader. Also what @tommy suggested should work but you need to use DB GroupBy node which also outputs sql query in DB Query tab.
you normally can do it with following SQL syntax.
SELECT Number_ID, SUM(Orders)
from [second table]
GROUP BY Number_ID
ORDER BY Number_ID
This is a basic SQL funtionality and should work for all SQL Databases.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.