mysql - Making one row many rows -


i have rows this:

 school      4  hotel       2  restaurant  6 

i have output this:

 school 1  school 2  school 3  school 4  hotel 1  hotel 2  restaurant 1  ...  restaurant 6 

is there mysql query can run output (i.e., number of rows output corresponds number in second field)?

thanks jb nizet telling me mysql not able on it's own. inspired me write php script:

$result = mysqli_query($dbc,"select abbrev,chapters books"); while ($output = mysqli_fetch_array($result,mysql_assoc)) {  ($i=1; $i<=$output['chapters']; $i++) {   echo "{$output['abbrev']}$i\n";  } } 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -