title: Need a query to replace strings(for values and names arranged in row wise) as shown below
body: <p>I need the values of price and weight to replaced in the expression column of formula1 table. COuld anyone help .</p>
  
  <p>I have the below query tried but there is some error.</p>
  
  <p>My query:</p>
  
  <pre><code>Select REPLACE((Select Expression from Formula1 
  where idnum =1),INPUTNAME,INPUTVALUES) AS TIME FROM Formula1
  </code></pre>
  
  <p>tABLE QUERY'S</p>
  
  <pre><code>Create table FORMULA1
  (
  Expression varchar(MAX),
  INPUTVALUES INT,
  InputName VARCHAR(256),
  )
  
  Insert into Formula1
  values('Price+Weight' ,23,'weight')
  
  Insert into Formula1
  values('' ,14,'PRICE')
  </code></pre>