How to compare strings as int in EAV model?
easiest is to ignore anything that does not look like an integer.

select e.* , av.value
FROM attribute_value AS av 
JOIN attribute AS a ON av.attribute_id = a.id
JOIN entity AS e ON av.entity_id = e.id
WHERE 
   a.label = 'marks12'
 AND 
   CASE WHEN av.value ~ '[+-]?[0-9]{1,20}' THEN av.value::bigint END &lt; 100;


this is much harder when value might be a date,