I am trying to avoid Inserting one record at a time so i need some help;
Here is an example table named Foods:
ID UniqueID Name Type
1 Apple101 Apple Fruit
2 Ban 11 Banana Fruit
3 abc 123 Carrot Vegetable
4 xyz123 Mango Fruit
5 bnb123 Spinach Vegetable
Now i have another Table name "Food Data" which has the following fields:
ID UniqueID FoodPrice FoodExpiry
What i am trying to do is create the table above by recovering all the records from the table Foods which are Fruits and inserting into this table the thing is i have some external parameters (FoodPrice,FoodExpiry) . At the end i need the table Food Dataas below:
ID UniqueID FoodPrice FoodExpiry
1 Apple101 100$ 2 months
2 Ban 11 100$ 2 months
3 xyz123 100$ 2 months
The FoodPrice & FoodExpiry will remain the same for a given Query.
In Algorithmic terms i need an equivalent of :
Select UniqueID from Foods where Type ='Fruit' and loop all the UniqueID
and Insert into the table food Data , i want to this in one query .