I have two columns say Main and Sub. (they can be of same table or not).
Main
Sub
Main is varchar of length 20 and Sub is
Try
SELECT t1.* from "Main Table" AS t1, "SubTable" AS t2 WHERE t2.SubId=1043 AND substr(t1.MainColumn, 13, 8) LIKE "%" || CAST(t2.SubColumn as text);