I have 2 tables called table1 and table2. table1 has key, condition, level and conditionvalue columns and table2 has key and value columns.
table1 rows
key condition level conditionVal
1 > error 10
1 = info 5
2 < warning 5
2 > info 20
I will get inputs(key and value) from user or other source and that values I need to insert into table2 based on the following condition.
if key is 1 and value is > 10 or value is equal to 5 then i need to insert. if key is 2 and value is > 20 or value is less than 5 then i need to insert.
How to acheive this using sql insert statement.