I have three tables A, B and C.
A:
----------------
index_a | value
----------------
B:
----------------
index_b | value
----------------
C:
----------------------------
index_c | table_name | value_c
----------------------------
Now user gives me value ,Table name and new_value_c. Table name can be A or B and value is respective value of table A or B. Now if there exist a record matching given value in given table we will get index of that table (index_a or index_b) and try to insert that in table C if there is no record with that index and table name otherwise we will update new_value_c. If there is no record matching value and table name then we will not do nothing.
I know we can use one SELECT to get index of table A or B and then INSERT OR REPLACE INTO table C. I am wondering if it can be achieved in single sql command.