mysql> select * from catworld4 where id=9;
+----+------+
| id | name |
+----+------+
| 9 | abc |
+----+------+
1 row in set (0.00 sec)
mysql> delete from catworld4 where id=9;
Query OK, 1 row affected (0.05 sec)
mysql> select * from catworld4 where id=9;
Empty set (0.00 sec)
mysql> mysql> select * from catworld4 ;
+----+------+
| id | name |
+----+------+
| 4 | abc |
| 8 | abc |
| 1 | abc |
| 3 | abc |
| 7 | abc |
| 5 | abc |
| 2 | abc |
| 6 | abc |
| 10 | abc |
+----+------+
9 rows in set (0.01 sec)
mysql> select count(*) from catworld4;
+--------+
| COUNT0 |
+--------+
| 9 |
+--------+
1 row in set (0.01 sec)
mysql> select * from catworld4 order by id;
+----+------+
| id | name |
+----+------+
| 1 | abc |
| 2 | abc |
| 3 | abc |
| 4 | abc |
| 5 | abc |
| 6 | abc |
| 7 | abc |
| 8 | abc |
| 10 | abc |
+----+------+
9 rows in set (0.08 sec)
mysql> select distinct(name) from catworld4;
+------+
| name |
+------+
| abc |
+------+
1 row in set (0.09 sec)
mysql> insert into catworld4(name,id) values("def",9);
Query OK, 1 row affected (0.02 sec)
mysql> select distinct(name) from catworld4;
+------+
| name |
+------+
| abc |
| def |
+------+
2 rows in set (0.01 sec)
mysql> 本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。