How to solve error ORA-01795 : maximum number of expressions in a list is 1000 when running query

How a suggestion i saw online was like this

“Select msg_num,session_num,response_code,reversal_num,payment_num From xxx.xxx_xxxxx_xxxxx@xxx_xxxxx Where message_id in (’” + sessionStrings + “’) or message_id in (’” + sessionStrings + “’) ”… but i really don’t know what logic would split session strings into chunks again … i try to think of one it confuses me…lol