56,678
社区成员
发帖
与我相关
我的任务
分享
mysql> describe b;
+----------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+-------+
| bh | varchar(2) | NO | PRI | NULL | |
| id | int(10) unsigned | NO | PRI | NULL | |
| pid | int(10) unsigned | NO | | NULL | |
| sn | int(10) unsigned | NO | | 0 | |
| bm | varchar(10) | NO | | NULL | |
| ji | tinyint(1) | NO | | 0 | |
| bt | varchar(256) | NO | | NULL | |
| you | text | NO | | NULL | |
| hege | text | NO | | NULL | |
| banfa | text | NO | | NULL | |
| fz | decimal(5,2) | NO | | NULL | |
| isparent | tinyint(1) | NO | | 0 | |
+----------+------------------+------+-----+---------+-------+
12 rows in set (0.00 sec)
mysql> select id,pid,bt,isparent,sn from b where bh='33' ;
+----+-----+-------+----------+----+
| id | pid | bt | isparent | sn |
+----+-----+-------+----------+----+
| 1 | 0 | 增加1 | 1 | 0 |
| 2 | 1 | 增加2 | 0 | 1 |
| 3 | 1 | 增加3 | 0 | 2 |
+----+-----+-------+----------+----+
3 rows in set (0.00 sec)
mysql> select id,pid,bt,isparent,sn from b where bh='33' order by sn;
Empty set (0.00 sec)
mysql>_