Hi,
I have been writing a stored procedure to retrieve a list of restaurants, but when using a function with the "AS" keyword to save the result into the fullmatch column, the WHERE statement does not recognize the fullmatch column, please help.
Here is the code:
Thank you in advance
I have been writing a stored procedure to retrieve a list of restaurants, but when using a function with the "AS" keyword to save the result into the fullmatch column, the WHERE statement does not recognize the fullmatch column, please help.
Here is the code:
Code:
ALTER PROCEDURE dbo.GetRestaurants ( @kws NVARCHAR (50) ) AS SELECT DISTINCT r.name, a.name , c.name , c.phone_key, dbo.findnumberofmatches(r.name,@kws) [B]AS fullmatch[/B] FROM area AS a INNER JOIN restaurants AS r ON a.id = r.area INNER JOIN city AS c ON c.id = a.city WHERE [B]fullmatch > 0[/B] ORDER BY fullmatch DESC RETURN
Comment