क्या आपका ऐसा मतलब है? SELECT SUM(cost) as total FROM sales where (passport = $myPassport AND paid <> 1)