mysql> describe s1_user_limits;
+--------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+------------------+------+-----+---------+-------+
| uid | int(10) unsigned | NO | PRI | 0 | |
| _limit | int(3) | YES | | NULL | |
+--------+------------------+------+-----+---------+-------+


INSERT INTO s1_user_edit (id,uid,parent,_key,status,email) SELECT NULL,
0, su1.uid, 'Ln3eRX0RVuzFS3Jzg2iWDEpMy9Lg2DyN', 4, 'aaaaaa.com' FROM
s1_user_limits AS sul, s1_user AS su1 LEFT JOIN s1_user AS su2 ON
(su2.parent=su1.uid) LEFT JOIN s1_user_edit AS sue ON
(sue.parent=su1.uid) WHERE su1.uid=1 AND sul.uid=su1.uid HAVING
(sul._limit-(count(su2.uid)+count(sue.id)))>0;


query returns
ERROR 1054 (42S22): Unknown column 'sul._limit' in 'having clause',
just don't know why it cannot see this column :(

MySQL server version: 5.0.18


Any ideas ??