1 在oracle数据库,有个表里面的字段为int类型,这个字段只有三个种值:0和1和空的。
要查询值不为1的结果。怎么表示呀
oracle中 <>表示不等号 
where NVL(num,0) = 0 
2 我想要得到本周内要上的课程。where条件里面该怎么写呢? 
select course from tbl where begintime between datename(weekday, GETDATE()) and 
......
这个后面要怎么写呢?
例如,假如今天是周2,那我要得到本周 周2至周6的课。 假如今天是周日,那要得到本周 
周日至周6的课
select Class_ID,Course_Code,Forct_Date  from tbl_Class_Profile where Forct_Date
   between  CONVERT(varchar(100),GETDATE(),23) and  CONVERT(varchar
(100),getdate()+(7-datepart(weekday,getdate())),23)
3 时间后面加时分秒
  string s = "2012-2-2";             DateTime d = Convert.ToDateTime(s).AddDays
(1).AddSeconds(-1); 
4 如何计算两个时间之间的年,月,日,天的差数?
to_number(to_char(sysdate,'yyyy')) - to_number(to_char(day1,'yyyy')) as yeardel 
,
to_number(to_char(sysdate, 'mm'))   -   to_number(to_char(day1, 'mm')) as 
mothdel,
to_number(to_char(sysdate, 'dd'))   -   to_number(to_char(day1, 'dd')) as daydel 
这样是年月日,分开来相减的,这样减出来后,月和日 可能有负数,所以还得判断。假如day1
的值为2008-12-3 则结果是 年3,月-1,日4  而不是 年2,月11,日4  
 所以想用其他的办法.
trunc((months_between(trunc(sysdate,'dd'), day1))/12) as year  这样,结果是单纯的
年,并且是正确的年.我想用这种类似的函数计算出月和日.   可是不知道怎么使用函数?? 
5 学生年龄增长的问题
每年生日增长
SELECT DATEDIFF(YEAR,'2010-4-10','2013-4-10') + case when DATEDIFF(DAY,DATEADD
(YEAR,DATEDIFF(YEAR,'2010-4-10','2012-4-9') ,'2010-4-10'),'2013-4-10') < 0 then 
-1 else 0 end
AS DiffDate 
6在windows8里面,作了一个任务计划,定时自动备份数据库。定时自动备份出来的数据库
名称,想以当天的时间命名,例如今天是20120817    就想备份出来的数据库为
20120817.dmp  这个在windows2003里面执行成功,在windows 08里面不行。这个要怎么取
名字呀?  定时每天备份的。 在windows 2003里面是这样写的:oracle%date:~0,10%.dmp
  现在在windows 08里面怎么写呀?
写成expData.bat批处理试一下呢
expData.bat的内容:
exp system/system@orcl file=c:\oracle_bak\tne%date:~4,10%.dmp owner=tne   exp system/system@orcl file=c:\oracle_bak\prt%date:~4,10%.dmp owner=prt   exp system/system@orcl file=c:\oracle_bak\sec%date:~4,10%.dmp owner=sec   exp system/system@orcl file=c:\oracle_bak\tea%date:~4,10%.dmp owner=tea   exp system/system@orcl file=c:\oracle_bak\pic%date:~4,10%.dmp owner=pic   exp system/system@orcl file=c:\oracle_bak\system%date:~4,10%.dmp owner=system   path=D:\WinRAR 3.20  rar a Data%date:~4,10%.rar *%date:~4,10%.dmp  del *%date:~4,10%.dmp  在 %date:~0,4%%date:~5,2%%date:~8,2%  这个才行呢   是批处理。
7 如何计算两个时间参数之间的年,月,天 的差数?
  to_number(to_char(sysdate,'yyyy')) - to_number(to_char(day1,'yyyy')) as yeardel 
,
to_number(to_char(sysdate, 'mm'))   -   to_number(to_char(day1, 'mm')) as 
mothdel,
to_number(to_char(sysdate, 'dd'))   -   to_number(to_char(day1, 'dd')) as daydel 这样是年月日,分开来相减的,这样减出来后,月和日 可能有负数,所以还得判断。假如day1
的值为2008-12-3 则结果是 年3,月-1,日4  而不是 年2,月11,日4  答案:
select datediff(day,'2006-10-1','2007-10-1')
select datediff(year,'2006-10-1','2007-10-1')
select datediff(month,'2006-10-1','2007-10-1')
出现负值,用 ABS()函数