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子句前 ......
<?php
class mysql {
/*+++++++++++++++数据库访问类++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
//=================================================
//连接数据
private $Hos ......
今天发现在使用PL/SQL时,无法登陆。经过群里朋友的帮忙,最后圆满解决,现留个记录以便以后可查。
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
......
DECLARE @ServerName nvarchar(50) --数据库服务器名称(数据库服务器IP)
DECLARE @DataBaseName nvarchar(50) --数据库名称
DECLARE @UserName nvarchar(50) --登录数据库用户ID
DECLARE @UserPwd nvarchar(50) --登录数据库密码
DECLARE @TbName nvarchar(50) --表名字
DECLAR ......