Dear KNIMErs,
still trying to find my way through working with databases without having to learn SQL (I am lazy as hell )
Here’s my question:
I have a table that holds two columns, let’s call them ID_1 and ID_2, see screenshot below
I have a set of rules that define, what type of (database) line item this is:
- IF ID_1 IS NOT MISSING and ID_2 IS MISSING → then it’s a DELETE
- IF ID_1 IS MISSING AND ID_2 IS NOT MISSING → then it’s an INSERT
- IF ID_1 IS NOT MISSING AND ID_2 IS NOT MISSING → then it’s an UPDATE
I can easily define this locally in KNIME using a Rule Engine node (see screenshot below)
This (local) Rule Engine shows the mode appending a new column (which probably is not possible on database level).
What I want to do instead is
- if the type is DELETE use ID_1
- if the type is INSERT use ID_2
- if the type is UPDATE use ID_2
Is such a “set of rules” possible on database level as well? The reason I am asking is that I need to run this “query” daily and I somehow want to avoid to download 20 million lines just to throw 99.9% away.
Can you help me stay lazy?
Thanks a lot in advance.