You should search for
CASE statement on MSDN. This is basically what you need to handle conditions in your requests.
But there is something wrong in your query : you make a join between tables a and b, but you don't use table b in your SELECT part. Moreover, if you are using MS SQL Server, the syntax is incorrect. It should be:
SELECT
a.code
,a.price
,CASE
WHEN (a.check = 1) THEN (a.price * b.percent)
ELSE (a.price * b.percent * 8)
END
AS new_field
FROM a INNER JOIN b ON a.code = b.code
[Edit] Included change with CASE statement
[Edit2] Replaced MSDN link with an english one