mysql - repeat result multipple times in my sql -
I have no id and no fields, what exactly do I want, the result will not be filed any time , If there is no field 2, then raw should be repeated twice as a result. This is my sample table structure
id no 1 3 2 2 3 1 Now I need to get results like
I 1 3 1 3 1 3 2 2 2 2 3 1 I tried to write mysql query to get the above results, but any help in failing
You need a table of numbers to accomplish this. For just three values, it's easy: choose
t.id, choose t.no to t join (t 1no n select as union and select all union all 3) n ; = N.no;
Comments
Post a Comment