T-sql get min and max value for each day
I am trying to write a query where for each day I get the minimum and maximum price for each item from price details table. In price details table prices are set multiple times a day so there are many records for the same date. So I want a table where there is one row for each date and then join that table to the same table so for each distinct date I want the minimum and maximum value. USE [a_trading_system] GO /****** Object: Table [dbo].[price_details] Script Date: 07/01/2012 17:28:31 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[price