Thanks for the response but neither one of the responses I've received does 
exactly what I need since they don't return multiple rows.
 
Are there any other ideas out there?
 
Thanks

>>> "Jay Blanchard" <[EMAIL PROTECTED]> 4/7/06 12:37:32 PM >>>
[snip]
Anyone have an idea on this?

Can anyone explain how I might be able to return a numbers of records
based on the sum of a quantity in a field in the same table? (After I
read that it sounds even confusing to me).

Let me explain. I have records like this,

Part# Qty
1254 5
1414 2
14758 1
1254 6
1024 3
1254 1


Now if I did a query like this
Select Part#, Sum(Qty) From table1 Group By Part# Where Part#=1254

I would expect my results to look like this
Part# Sum(Qty)
1254 12

But what I really want is this
Part#
1254
1254
1254
1254
1254
12541254
1254
12541254
1254
1254

So 12 virtual records for the count of the records returned from the
Sum()
[/snip]

Please do not hijack threads, open a new e-mail and send it to the list
address.

SELECT REPEAT(Part#, count(Part#)) FROM table WHERE Part# = '1254'


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql 
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] 



Reply via email to