sql server 2008 - Sql Query to Get Nearest Value -


कल्पना कीजिए मेरे पास निम्न तालिका है:

  --------- ----------------- आईडी - नो ओफ़रर्स 1 - 1 2 - 3 3 - 5   

मुझे पैरामीटर पर निकटतम मान प्राप्त करने की आवश्यकता है । उदाहरण के लिए मैं "4" पैरामीटर के रूप में भेजता हूं जिसके परिणामस्वरूप मुझे आईडी 2 की आवश्यकता है I

  तालिका से चयन आईडी जहां नो ऑफ़रर्स & lt; = param ORDER BY NoOfOrders DESC LIMIT 1 < कोड>   

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -