';
# $t{line_one} = $t{line_one} . $t{id1} . ' | ';
# $t{line_one} = $t{line_one} . $t{time1} . ' | ';
# $t{line_one} = $t{line_one} . $t{orderno1} . ' | ';
# $t{line_one} = $t{line_one} . $t{post1} . ' | ';
# $t{line_one} = $t{line_one} . $t{posttime} . ' | ';
# $t{line_one} = $t{line_one} . $t{paytime} . ' | ';
# $t{line_one} = $t{line_one} . $t{paymemo} . ' | ';
# $t{line_one} = $t{line_one} . $t{invoice1} . ' | ';
# $t{line_one} = $t{line_one} . ' |
';
#
# $$row_ref{line_one} = $t{line_one};
# push(@loop, $row_ref);
# }
# $t{sth}->finish;
----------------------------------------------------------------
mysql> select time,orderno,post,posttime,paytime,paymemo,invoicetime FROM order1
WHERE orderno != 'NULL' AND orderno != 'NO' AND ((YEAR(time) = '2011' and MONTH
(time) >= 10 and DAYOFMONTH(time) >= 1) OR (YEAR(time) = '2012' and MONTH(time)
<= 3 and DAYOFMONTH(time) <= 30)) ORDER BY time DESC;
----------------------------------------------------------------
取出2011年10月1日-2012年9月30日的订单
mysql> select id, time, orderno from order1 where orderno != 'NULL' and orderno
!='NO' and ((YEAR(time) = 2011 and MONTH(time) >= 10 and DAYOFMONTH(time) >= 1)
or (YEAR(time) = 2012 and MONTH(time) <=9 and DAYOFMONTH(time) <=30));
mysql> select id, time, orderno from order1 where orderno != 'NULL' and orderno
!='NO' and ((YEAR(time) = 2011 and MONTH(time) >= 10 and DAYOFMONTH(time) >= 1)
or (YEAR(time) = 2012 and MONTH(time) <=9 and DAYOFMONTH(time) <=30)) ORDER by t
ime limit 5;
+-------+------------+---------------+
| id | time | orderno |
+-------+------------+---------------+
| 17004 | 2011-10-03 | JDA-SP-028-11 |
| 17003 | 2011-10-05 | 5OCT-11 TAN |
| 17032 | 2011-10-05 | |
| 16780 | 2011-10-05 | BWL-SP-039-11 |
| 16726 | 2011-10-06 | 104 |
+-------+------------+---------------+
取出不是NULL和'NO'(取消的ORDER)的所有ORDER订单。
mysql> select id, time, orderno from order1 where orderno != 'NULL' and orderno
!='NO';
+----+------------+---------------+
| id | time | orderno |
+----+------------+---------------+
| 18 | 2008-06-03 | GIM-SP-036-08 |
| 24 | 2008-07-16 | TNF-ST-016-08 |
| 25 | 2008-08-29 | GGL-SP-015-08 |
| 27 | 2008-09-17 | B2229 |
| 29 | 2008-07-19 | JTG-SP-015-08 |
+----+------------+---------------+