You can have UDF in the condition of where clause.