Re: Best Fit SQL query statement

From: Rodrigo De León <rdeleonp(at)gmail(dot)com>
To: depesz(at)depesz(dot)com, "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>, Kiran <kumar(dot)m(dot)kiran(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Best Fit SQL query statement
Date: 2007-08-11 01:13:46
Message-ID: a55915760708101813u5e5aab6cv198f7c7348083a95@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 || '%';

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Heikki Linnakangas 2007-08-11 07:42:54 Re: Performance on writable views
Previous Message hubert depesz lubaczewski 2007-08-10 22:59:53 Re: Best Fit SQL query statement