Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Get Minimum Price from Overlapping valid dates - response (1) by dnoeth

$
0
0

For your example this should be a simple:

SELECT
   prod_id, price, vld_fr_dt
FROM tab
QUALIFY 
   ROW_NUMBER()
   OVER (PARTITION BY prod_id, vld_to_dt 
         ORDER BY price) = 1

 


Viewing all articles
Browse latest Browse all 27759

Trending Articles



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