Hi, I am trying to show the books that cost more than the average book price using variable. I am using Microsoft SQL Server 2005. I am getting the following error message:
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'from'.
DECLARE @X int;
SELECT @X = AVG(BKListPirce);
WHERE BKListPrice < AVG(BKListPirce)