How to generate simple Packing List with MySQL ?
Posted
by Stephen
on Stack Overflow
See other posts from Stack Overflow
or by Stephen
Published on 2009-10-24T05:34:51Z
Indexed on
2010/04/01
9:03 UTC
Read the original article
Hit count: 972
Hi,
I need help on how to create a packing list of a shipment with MySQL.
Let's say i have 32 boxes of keyboard ready to ship, the master carton can contain 12 boxes.
I only have value 32 boxes and volume of 12. The other value in result below is generated by sql command. Not coming from record.
So this easily calculate that the number of master carton would be 3 master cartons, with one as a non-standard quantity. How to perform query on this ?
As i would like to be this result:
+----------+---------------+-------------------+--------+------------+---------+
| Quantity | Standard_Qty | Non_Standard_Qty | Box_N | Box_Total | RowType |
+----------+---------------+-------------------+--------+------------+---------+
| 12 | 1 | 0 | 1 | 3 | Detail |
| 12 | 1 | 0 | 2 | 3 | Detail |
| 8 | 0 | 1 | 3 | 3 | Detail |
| 32 | 2 | 1 | | | Summary |
+----------+---------------+-------------------+--------+------------+---------+
It looks like two query i know and probably the use of FLOOR command, in which i was teach in here. How to make this result?
Thanks in advance. Stephen
© Stack Overflow or respective owner