Sql Statement Like Pattern Matching Haskell