Tuesday 15 July 2014

Take only few values from SQL Query -


I have a SQL query, which looks at the cost of some substitutions (provided by some providers), it The thing is that I only need those providers who give me replacement for low cost (they can be 1, 2 or more)

I have this question and then I bother it with code Am I, but there is another way to do this that I only want to do with SQL?

  Select from tprovider_treplacement * where replace_id =? Order by value   

Thanks a lot ?? ยบ

Do you want something like that?

  Select from tprovider_treplacement * where replace_id =? And value = (tprovider_treplacement replacement_id =?) To select minimum (value)?   

This standard is supported by SQL using many database window functions:

  choose from * (select copy * * *, Tprovider_treplacement PR as minprice (where replace_id =?)) At the lowest (price) segment (by replacement_ID), where value = mineprase    

No comments:

Post a Comment