I have column Conveyor with conveyor name entries in the table Report_Line which I want to replace with conveyor no.
Belt - 1 | Slack - 2 | Chain - 3
It's real time scenario, as soon as a row is added with data, according to the name of conveyor, it should get replaced with it's respective number.
I tried replace query with Union statement but didn't work, throws error
SELECT TOP 1 *
FROM Report_Line
ORDER BY Serial_no DESC
SELECT REPLACE(Conveyor, 'Slack', '2')
UNION
SELECT REPLACE(Conveyor, 'Belt', '1')
UNION
SELECT REPLACE(Conveyor, 'Chain', '3')
GO