Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Query language and DCS > Best supplier price query

Forum

Search UsersRules
Best supplier price query
#1
Active user
Points:: 0
Joined:: Sep 27, 2011

Hello!
I have a complicated question about queries this time.
There is Prices periodical (days) information register:
Dimensions:
Item
Counterparty
Resources:
Price

I need too get best prices for the current day and counterparties which sell with this price. Have no idea how to do this.

Profile
#2
Active user
Points:: 0
Joined:: Nov 1, 2011

Try something like this

Code
SEL ECT
   PricesSliceLast.Item,
   PricesSliceLast.Counterparty,
   PricesSliceLast.Price
FROM
   InformationRegister.Prices.SliceLast AS PricesSliceLast
      INNER JOIN (SELECT
         PricesSliceLast.Item AS Item,
         MIN(PricesSliceLast.Price) AS MinPrice
      FR OM
         InformationRegister.Prices.SliceLast AS PricesSliceLast
      
      GROUP BY
         PricesSliceLast.Item) AS MinPriceTable
      ON PricesSliceLast.Item = MinPriceTable.Item
         AND PricesSliceLast.Price = MinPriceTable.MinPrice

Profile
#3
Active user
Points:: 0
Joined:: Sep 27, 2011

Thank you, Alexey! This works very good!

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.