Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO DUPLICAT ROWS!

Status
Not open for further replies.

FLUZZI

Programmer
Jul 13, 2000
17
0
0
BR
Hi!<br><br>I have a table with this columns<br><br>ID-identity<br>QT- INT<br><br>A need to do a sql that repeat a row many times is &quot;QT&quot; column. Like this:<br><br>Table rows<br>ID ¦ QT<br>1&nbsp;&nbsp;¦ 3<br>2&nbsp;&nbsp;¦ 5<br>3&nbsp;&nbsp;¦ 2<br>4&nbsp;&nbsp;¦ 6<br><br>a need a sql with this results:<br>ID<br>1<br>1<br>1<br>2<br>2<br>2<br>2<br>2<br>3<br>3<br>4<br>4<br>4<br>4<br>4<br>thanks in advance and sorry about my english. I'm from brazil and a i still learning!
 
i dont think this can be done with one query.. why dont u try with a temp table and then do a select..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top