易截截图软件、单文件、免安装、纯绿色、仅160KB

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                |
+----+-------


相关文档:

Mysql 数据库字符集转换及版本升级/降级的详细教程

看到不少用户反映转换完以后是乱码的情况,出现这种现象的主要原因是这类用户使用的都是mysql4.1以上的版本.下面作一个说明,希望出现这个问题的朋友都能耐心的把这个文档看完!!!
MySQL 4.1开始,对多语言的支持有了很大变化 (这导致了问题的出现)。尽管大部分的地方 (包括个人使用和主机提供商),MySQL 3、4.0 仍然占主导地 ......

SQl 2005 For XMl 简单查询(Raw,Auto,Path模式)(1)

 很多人对Xpath可能比较熟悉,但不知道有没有直接操作过数据库,我们都知道 在Sql2005里公支持的几种查询有Raw,Auto,Path模式等,如果在2000里使用过 Path模式的朋友应该知道,是不容易处理查询结果的,那么在2005里对这一块做了很好的提升
        我先来介绍一下什么是Sql F ......

SQL服务器:CONVERT与CAST区别何在


如果SQL Server程序员想将表达式从一种换为另一种,他可以从SQL Server 7和2000中自带的两种功能中做出选择。在存储过程或其他情况下,我们常常需要将数据从datetime型转化成varchar型;CONVERT和CAST就可以用于这种情况。
  由于SQL Server提供两种功能,因此应该选择哪种功能或应该在哪种情况下使用该功能就很容易让 ......

网上找到的SQL库比较语句

以下是第一篇:
/*--比较两个数据库的表结构差异
--*/
/*--调用示例
exec p_comparestructure 'xzkh_model','xzkh_new'
--*/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_comparestructure]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[p_comparestructure ......

SQL 跨库查询

DECLARE @ServerName nvarchar(50) --数据库服务器名称(数据库服务器IP)
DECLARE @DataBaseName nvarchar(50) --数据库名称
DECLARE @UserName nvarchar(50)   --登录数据库用户ID
DECLARE @UserPwd nvarchar(50)   --登录数据库密码
DECLARE @TbName nvarchar(50)   --表名字
DECLAR ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号