On 8/10/07, hubert depesz lubaczewski <depesz(at)depesz(dot)com> wrote:> unfortunatelly this query will be hard to optimize.
Uh, how about
SELECT MAX(t1) FROM t1 WHERE '9849' LIKE t1 || '%';