- 论坛徽章:
- 1
|
mysql> select op_id,op_type,op_time from operate where op_id > '2';
+-------+--------------+----------+
| op_id | op_type | op_time |
+-------+--------------+----------+
| 3 | after_delete | 05:37:13 |
| 4 | hhhhh | 06:06:21 |
| 5 | jjjjj | 06:06:42 |
| 6 | jjjjj | 06:09:57 |
| 7 | hhhhh | 06:10:30 |
+-------+--------------+----------+
5 rows in set (0.00 sec)
mysql> select op_id,op_type,op_time from operate where op_id > '2' group by op_type having op_type='jjjjj';
+-------+---------+----------+
| op_id | op_type | op_time |
+-------+---------+----------+
| 5 | jjjjj | 06:06:42 |
+-------+---------+----------+
1 row in set (0.01 sec)
本人刚学mysql,在学习sql查询语句时遇到如上的一种情况不解:第一语句查询时显示 jjjjj 有两行,可是下面的一条语句为什么只显示一行,应该显示两行才对啊!麻烦各位解释下?谢谢!!
|
|