- 论坛徽章:
- 0
|
set @id:=0;
select (@id:=@id+1) as sortid,applydate from item order by applydate
mysql> set @id:=0;
Query OK, 0 rows affected (0.00 sec)
mysql> select (@id:=@id+1) as sortid,applydate from item order by applydate;
+--------+---------------------+
| sortid | applydate |
+--------+---------------------+
| 1 | 2007-10-24 15:48:54 |
| 2 | 2007-10-25 13:24:22 |
| 3 | 2007-10-25 13:31:53 |
| 4 | 2007-10-25 13:39:47 |
| 5 | 2007-10-25 13:55:03 |
| 6 | 2007-10-25 13:57:20 |
| 7 | 2007-10-25 13:57:46 |
| 8 | 2007-10-25 14:02:03 |
+--------+---------------------+
8 rows in set (0.02 sec)
在mysql命令行可以正常执行,可是在 perl调用,怎么也不行,我估计是要设置参数?
'2007-10-24 15:48:54'
, '2007-10-25 13:24:22'
, '2007-10-25 13:31:53'
, '2007-10-25 13:39:47'
, '2007-10-25 13:55:03'
, '2007-10-25 13:57:20'
, '2007-10-25 13:57:46'
, '2007-10-25 14:02:03'
[ 本帖最后由 marsbird 于 2007-10-25 16:16 编辑 ] |
|