SELECT * 
FROM ( {my_str1} ) as tbl01
WHERE tbl01.t01p04a<>0
   && tbl01.t01p04a<>tbl01.t01p04t
   && substr(tbl01.p01, 1, 2)='{my_pref}'
   && tbl01.p303 in (1, 2, 3, 4, 6, 9, 13)
ORDER BY tbl01.p02, tbl01.remfdate, tbl01.remftime;
   