Reply to Re: select minimum between two values

Your name:

Reply:


Posted by Chris Cheney on 07/27/06 12:35

Generale Cluster <alexcarraro@carrarosoftmasters.net> wrote in news:eaa556
$2nm$1@newsreader.mailgate.org:

> Hello,
> I need to select the minimum between the result of a function and a
> number, but i can't find a smart way. By now I'm doing like the
> following, but I think is very expensive because it evaluates the
> function twice:
>
> select case when (myfunction())<100 then (myfunction()) else 100 end

One way, but not necessarily the smartest way:

select min(a) from (select myfunction() a union select 100 a) t

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация