Fix SQLTables when all the patterns are NULL