Best Fit SQL query statement - Mailing list pgsql-sql

From Kiran
Subject Best Fit SQL query statement
Date
Msg-id 1186390627.045596.148460@j4g2000prf.googlegroups.com
Whole thread Raw
Responses Re: Best Fit SQL query statement  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-sql
All,

Could anyone  help me in writing Best Fit SQL statement.
Suppose we have table t1 with coloumn t1 (text) with following rows.
98456
98457
9845
9846
984
985
98
99


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

Regards,
Kiran



pgsql-sql by date:

Previous
From: Lew
Date:
Subject: Re: Race condition in resetting a sequence
Next
From: Ranieri Mazili
Date:
Subject: Using function like where clause