sql - How to select every row N times in MySql table? -


i have mysql table below.

id         name          surname 1          joe           black 2          mary          peterson 3          bob           marley 4          andy          murray ... 

i want write select command return every row n times.
example n = 3.

select name, surname  blah-blah (3 times ) person name              surname joe               black joe               black joe               black mary              peterson mary              peterson mary              peterson bob               marley bob               marley bob               marley andy              murray andy              murray 

thank you.

you use union all result want, you'd better not such job sql.

select * (   select name, surname person   union   select name, surname person   union   select name, surname person ) order name 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -