sridevikavalakuntla wrote:i have to give custid as input(manually) so i should get the oreders related to that custid and the min request date.
So pass it as a parameter to the stored procedure.
CREATE PROCEDURE [dbo].[test_GetOrders]
WHERE o.ORD_CUS_ID = @CUST_ID
I would suggest you to buy a good SQL book or read articles on the web because it's the most basic thing that you should know if you are writing an SQL Query.