I have a 1 stored procedure in which i have used following query:
DECLARE @product_id int
select @product_id=id from rpidata where collection_id = 354
select @product_id
And it gives me only 1 last record. Now when i hit below query then it gives me 5 records.
select id,ngj_id,tul_price from rpidata where collection_id = 354
Now i want to get all these records and do loop to calculate other prices. Example:
DECLARE @product_id int
for loop start //To traverse all 5 records
select @product_id=id from rpidata where collection_id = 354
select @product_id
//My custom calculation for other fields.
for loop end
How can i do that ?