SELECT guides.namer as document, print_form.nm as print_form, cast(data_blob as text) as formula FROM "DBA"."print_form", "DBA"."print_blob" , guides Where cast(data_blob as text) like '%18%' and ("DBA"."print_form"."id_header" = "DBA"."print_blob"."id" or "DBA"."print_form"."id_footer" = "DBA"."print_blob"."id") and print_form.id_guide=guides.id;