SELECT cc.phone_number, bv.id, bvh.text, bvh.value, bvh.status as "satus bvh", bv.status as "visotro status" FROM contacts cc
INNER JOIN bot_visitors bv
ON bv.contact_id  = cc.id
INNER JOIN bot_visitors_history bvh
ON bvh.visitor_id = bv.id
WHERE cc.phone_number = '917722063348'
