My condition is
My query is returning this
2 10 150000 where 2=startingslab and 10 = endingslab
11 20 250000
21 31 150000
now i want to get the price details for startingslab =3. i.e 15000.I know i need to process it row by row as between is not working.
Is there any way except cursors and while loop to accomplish this.
EDIT
This query returns the above resultset
SELECT dbo.TBM_Slab_Details.SlabStartValue,
dbo.TBM_Slab_Details.SlabEndValue,
convert(int,(@MRP-(dbo.TBM_Slab_Details.Discount*@MRP)/100)) as SlabPrice
FROM dbo.TBM_SLAB
INNER JOIN dbo.TBM_Slab_Details ON dbo.TBM_SLAB.SlabId = dbo.TBM_Slab_Details.SlabId and productid=@productID
now i have a variable @slabvalue which holds slabvalue.
now for eg @slabvalue=3,I want 150000 from above resultset
if it is 12,I want 250000