SELECT 
	`iblock_inherited_property`.`ID` AS `ID`,
	`iblock_inherited_property`.`CODE` AS `CODE`,
	`iblock_inherited_property`.`TEMPLATE` AS `TEMPLATE`,
	`iblock_inherited_property`.`ENTITY_TYPE` AS `ENTITY_TYPE`,
	`iblock_inherited_property`.`ENTITY_ID` AS `ENTITY_ID`
FROM `b_iblock_iproperty` `iblock_inherited_property` 

WHERE `iblock_inherited_property`.`IBLOCK_ID` = 20
AND `iblock_inherited_property`.`ENTITY_TYPE` = 'B'
AND `iblock_inherited_property`.`ENTITY_ID` = '20'