title: SQL: Linking Column Value to Column Name to fulfill some conditions
body: <p><a href="https://i.stack.imgur.com/YboIc.png" rel="nofollow noreferrer" title="tooltip">Tables</a></p>
  <p>Base on the image, the TABLE B is my main table while the TABLE A is the rules or conditions for the TABLE B.</p>
  <p>I want to write a query such that when rules 1 in Table A, which stands for column [C1] having indicator 3.
  Then find the respective column name in TABLE B with respective value and replace the FILL value. The result that I wanted is like TABLE C.</p>
  <p>How can I do so?</p>