I am trying to execute the query as below in SQL Server but it is very slow due to the Replace
function, can anyone help in optimizing the query to run very fast
SELECT
dbo.Orders.OrigID
FROM
dbo.Orders
INNER JOIN
dbo.OrderedReports ON dbo.Orders.OrigID = dbo.OrderedReports.OrderID
WHERE
(REPLACE(Orders.Email, '^^', '''') = 'Khengtjinyap@gmail.com')