I am trying to display all the people who name Jason, and replace Jason to Jill.
However, I tried the following SQL statement is not working
SELECT * FROM DigitalTV WHERE REPLACE('Jason', 'ason', 'ill');
Assuming that the column you want to replace names is called NAME, you can use a query like:
SELECT
*,
REPLACE(NAME, 'ason', 'ill') As CHANGED_NAME
FROM DigitalTV
WHERE NAME='Jason';`
This will bring an extra column with the name CHANGED_NAME. If you do not want it, use each and every column name in the selector but NAME. It should be modified as REPLACE(NAME, 'ason', 'ill')
NAME='Jason', you could SELECT 'Jill' AS CHANGED_NAME. (No REPLACE necessary).