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

SQL 获取当前日期,年、月、日、周、时、分、秒

select GETDATE() as '当前日期',
DateName(year,GetDate()) as '年',
DateName(month,GetDate()) as '月',
DateName(day,GetDate()) as '日',
DateName(dw,GetDate()) as '星期',
DateName(week,GetDate()) as '周数',
DateName(hour,GetDate()) as '时',
DateName(minute,GetDate()) as '分',
DateName(second,GetDate()) as '秒'
结果:
2009-12-19 15:23:50.530 2009 12 19 星期六 51 15 23 50


相关文档:

sql 2005 存储过程分页 java 代码

 create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',         
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列 ......

SQl 语句(常见) 新建,删除,修改表结构

新建表:
create table [表名]
(
[自动编号字段] int IDENTITY (1,1) PRIMARY KEY ,
[字段1] nVarChar(50) default '默认值' null ,
[字段2] ntext null ,
[字段3] datetime,
[字段4] money null ,
[字段5] int default 0,
[字段6] Decimal (12,4) default 0,
[字段7] image null ,
)
删除表:
Drop table [表 ......

Excel中数据导入到SQL Server数据库

using System.Data.SqlClient;
using System.Data.OleDb;
  private void tsmiImportTeacherInfo_Click(object sender, EventArgs e)
        {
            DataSet ds;
        ......

PL/SQL Developer 中文乱码解决

1。select * from v$nls_parameters 
查询nls的参数,获得数据库服务器端的字符编码 
NLS_LANGUAGE 
NLS_CHARACTERSET 
2。修改本地环境变量,设置 
NLS_LANG = SIMPLIFIED CHINESE.ZHS16GBK //这个是我们的数据库字符编码 
NLS_LANG格式: 
NLS_LANG = language_territory.char ......

【复习】SQL 内,外,左,右连接

信息表(infor)工资表(pay)
内连接
select pay.name,infor.AGE,PAY.MONEY,infor.email from pay  join infor on infor.name=PAY.name
左外连接
select pay.name,infor.AGE,PAY.MONEY,infor.email from pay  left join infor on infor.name=PAY.name
PS:结果有王五,工资为0
右外连接
select pay.name,info ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号