Best Fit SQL query statement

From: Kiran <kumar(dot)m(dot)kiran(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Best Fit SQL query statement
Date: 2007-08-06 08:57:07
Message-ID: 1186390627.045596.148460@j4g2000prf.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Steve Midgley 2007-08-06 12:20:05 Re: Increment a sequence by more than one
Previous Message Peter Childs 2007-08-06 07:00:31 Re: Increment a sequence by more than one