inserting sql with loop -


i have table personal

id_pers   name  --------------- 11         azerty 22         uiop 

and table tourne_label

id_tour   name  -------------- 1         w 2         p 3         v 

i want loop on of person , join tourne , insert new table.

i have created empty table ls_pda

id_pers   id_tourn ------------------- 11         1 11         2 11         3 22         1 22         2 22        3 

how can ?

sql set based operations. if you're thinking loop, chances you're heading in wrong direction. problem, cross-join tables, producing possible combinations, , use insert-select syntax:

insert ls_pda select      id_pres, id_tour        personal cross join  tourne_label 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -