Re: Best Fit SQL query statement

From: Rodrigo De León <rdeleonp(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Best Fit SQL query statement
Date: 2007-08-06 15:15:12
Message-ID: 1186413312.263516.180000@l70g2000hse.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Aug 6, 3:57 am, Kiran <kumar(dot)m(dot)ki(dot)(dot)(dot)(at)gmail(dot)com> wrote:
> and if I query on 98456 the result must be 98456,
> However if I query on 98455 the result must be 9845
> and If I query 9849 the result must be 984

SELECT MAX(t1)
FROM t1
WHERE '9849' LIKE t1 || '%';

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ranieri Mazili 2007-08-06 19:44:29 Using function like where clause
Previous Message Steve Midgley 2007-08-06 12:20:05 Re: Increment a sequence by more than one