SQL get the value above(larger) and below(smaller) of an inbetween value in a select statement -



SQL get the value above(larger) and below(smaller) of an inbetween value in a select statement -

i have table containing 2 columns "allowable" , "thickness".

the thickness values allow 1.2 2 3 4,3 i'm trying write udf can take thickness (eg2.3) , interpolates allowable values. question if there smart (or maybe out of box) function returns upper , lower thickness value need (2 , 3). regards, lumpi i'm using ms sql server 2008..

select 'max', max(thickness) value thicknesses thickness < requirement union select 'min', min(thickness) value thicknesses thickness > requirement

sql select

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -