For loop mysql procedures

Hi Forum

how can I make for loop or while loop as below, in mysql language

for i in (1, 2, 4, 6, 9)
do

......

done

similar to unix...

Hello yahyaaa ,

I have a few to questions pose in response first:-

  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • Does this need to be with a single mysql call, or would you be okay to loop in the shell calling mysql multiple times?
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)

Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.

We're all here to learn and getting the relevant information will help us all.

Robin