thanks alot for your help.
Dimitris
Quoting Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>:
> SELECT ... from ..... WHERE X LIKE pattern || '%' ORDER BY> length(pattern) DESC LIMIT 1;>> ???>> basic prefix matching for telcos :P>> --> GJ>