Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Select first record value from each group (where group is from multiple column)

$
0
0

Hello,

I have one table for data exchange and I have structure

SKU, Year, Month, Week, Day, Qty

column Qty can be sales, stock and so.

Now I need to return for example stock at the begining of the year for ever SKU, or at the begining of the month or week, but some sku doesn't have any Qty at first day of year, month, week it can be any day in year for example one SKU can have first change in secound week of five month and for that SKU start of year is that Qty, start of month is that Qty also.

Thanks in advance ...


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>