首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

MySQL中的几个话语

2012-08-13 
MySQL中的几个语句1.计算数据表中一共有多少记录sql语句mysql select count(*) from openes+----------+

MySQL中的几个语句
1.计算数据表中一共有多少记录sql语句
mysql> select count(*) from openes;
+----------+
| count(*) |
+----------+
|      136 |
+----------+
1 row in set (0.00 sec)

2.查询字段类型为datetime的SQL语句:


mysql> select * from biders where author_id =2253 and created_at between   '2009-11-10   00:00:00 '   and   '2009-11-10   23:59:59
';
+----+-----------+---------------------+---------------------+---------------------+
| id | author_id | created_at          | updated_at          | num_of_target_files |
+----+-----------+---------------------+---------------------+---------------------+
|  10 |      2353 | 2009-11-10 15:21:08 | 2009-11-10 15:21:08 |                NULL |
+----+-----------+---------------------+---------------------+---------------------+
1 row in set (0.00 sec)


3.修改数据库某个字段的值:

mysql> update products set image_url='/images/1.jpg'where id=13;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

热点排行