Gowtham Ramamoorthy
asked on
Need a query to replace strings:
Hi,
I need the values of price and weight to replaced in the expression column of formula1 table. COuld anyone help .
I have the below query tried but there is some error.
My query:
Select REPLACE((Select Expression from Formula1 where idnum =1),INPUTNAME,INPUTVALUES) AS TIME FROM Formula1
tABLE QUERY'S
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')
I need the values of price and weight to replaced in the expression column of formula1 table. COuld anyone help .
I have the below query tried but there is some error.
My query:
Select REPLACE((Select Expression from Formula1 where idnum =1),INPUTNAME,INPUTVALUES)
tABLE QUERY'S
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')
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
for your following question it seems to be a bit complicated, you probably can open another new question with your new requirements so that other experts may get a chance to assist you from there on.
ASKER
Imagine that we dont know the input column names 'price ' or weight. In that case this query wont work.