好长的SQL!
select a.FRMNO,a.GATE,a.MSGID,a.MailSendTime,a.UserNM, a.MailSubject,a.IsRead,a.FRMID,a.isattach,b.STATE ,a.FLOWSTATE from ROAMSGE a, ROASTAT b where a.FRMID = b.FRMID and b.state='1' and a.FrmNm like '%" + Cdorpsel1 + "%' and a.MAILSENDTIME>to_date('" + date1 + "','YYYY-MM-DD') and a.MAILSENDTIME<=to_date('" + date2 + "','YYYY-MM-DD')+1 and a.ToUserId='" + flw_LogonId + "' order by MAILSENDTIME desc
相关文档:
1 ,对于日期字段字段
access表示为:#1981-28-12#
SQLSERVER2000表示为:''1981-02-12''
2,SQL语句区别,select ,update 在对单表操作时都差不多,
但多表操作时update语句的区别ACCESS与SQLSERVER中的Update语句对比:
SQLSERVER中更新多表的Update语句:
Update Tab1
SET a.Name = b.Name
from Tab1 a,Tab2 b
Whe ......
如果在SQL Server
里需要定时或者每隔一段时间执行某个存储过程或3200字符以内的SQL语句时,可以用管理->SQL Server代理->作业来实现。
1、管理->SQL Server代理->作业(按鼠标右键)->新建作业->
2、新建作业属性(常规)->名称[自定义本次作业的名称]->启
用的方框内是勾号->分类处可 ......
select * from student where name=?;
如果不用单引号引起来, pstmt.setString(1,"xx or 1=1");即sql应该就是select * from student where name=xx or 1=1就可以全部查出。
强制单引号引起来,select * from student where name='xx or 1=1'。就无效了。
数值型的没有要求用单引号引起来,应该是由于有一个转换过 ......
1、查看表空间的名称及大小
select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size
from dba_tablespaces t, dba_data_files d
where t.tablespace_name = d.tablespace_name
group by t.tablespace_name;
2、查看表空间物理文件的名称及大小
select tablesp ......