Logic of this sort probably best belongs in the presentation, rather than database, layer of your application. However, it is nevertheless possible using either MySQL's IF()
function or its CASE
expression—for example:
SELECT art, type, IF(type='b',NULL,price) price FROM x;
See it on sqlfiddle.