MySQL中用sql语句插入时期
mysql> create table testdate(
-> id int not null auto_increment primary key,
-> time date);
Query OK, 0 rows affected (0.30 sec)
mysql> insert into testdate(time) values('2010-4-23');
Query OK, 1 row affected (0.06 sec)
mysql> select * from testdate;
+----+------------+
| id | time |
+----+------------+
| 1 | 2010-4-23|
+----+------------+
1 row in set (0.00 sec)
mysql> alter table testdate add column current time;
Query OK, 1 row affected (0.25 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> update testdate set current='21:18:00' where id=1;
Query OK, 1 row affected (0.06 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from testdate;
+----+------------+----------+
| id | time | current |
+----+------------+----------+
| 1 | 2010-4-23 | 21:18:00 |
+----+------------+----------+
1 row in set (0.00 sec)
mysql> alter table testdate add column combine timestamp;
Query OK, 1 row affected (0.14 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> update testdate set combine='20050504212000' where id=1;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql> select * from testdate;
+----+------------+----------+---------------------+
| id | time | current | combine |
+----+-------
相关文档:
“Where” 是一个约束声明,使用Where来约束来之数据库的数据,Where是在结果返回之前起作用的,且Where中不能使用聚合函数。
“Having”是一个过滤声明,是在查询返回结果集以后对查询结果进行的过滤操作,在Having中可以使用聚合函数。
在说区别之前,得先介绍GROUP BY这个子句,而在说GROUP子句前 ......
1、修改MySql数据库的my.ini配置文件、
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If yo ......
很多人对Xpath可能比较熟悉,但不知道有没有直接操作过数据库,我们都知道 在Sql2005里公支持的几种查询有Raw,Auto,Path模式等,如果在2000里使用过 Path模式的朋友应该知道,是不容易处理查询结果的,那么在2005里对这一块做了很好的提升
我先来介绍一下什么是Sql F ......
如果SQL Server程序员想将表达式从一种换为另一种,他可以从SQL Server 7和2000中自带的两种功能中做出选择。在存储过程或其他情况下,我们常常需要将数据从datetime型转化成varchar型;CONVERT和CAST就可以用于这种情况。
由于SQL Server提供两种功能,因此应该选择哪种功能或应该在哪种情况下使用该功能就很容易让 ......
SQL SERVER 和EXCEL的数据导入导出
通常的方法是使用图形界面的dts工具,但发觉有些使用命令行界面的方式更简单
1、在SQL SERVER里查询Excel数据:
-- ======================================================
SELECT *
from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\book1.xls";Use ......