SQL 按周,月,季度,年查询统计数据
//按自然周统计
select to_char(date,'iw'),sum()
from
where
group by to_char(date,'iw')
//按自然月统计
select to_char(date,'mm'),sum()
from
where
group by to_char(date,'mm')
//按季统计
select to_char(date,'q'),sum()
from
where
group by to_char(date,'q')
//按年统计
select to_char(date,'yyyy'),sum()
from
where
group by to_char(date,'yyyy')
相关文档:
SQL Server Out Put Excel File
在 SQL Server中, 导出EXCEL 文件, 用到 bcp.exe
bcp 导出的本质是纯文本文档,
若数据含有中文,请导出到中文版EXCEL,或TXT文档等, 否则乱码....
用TXT 打开英文版EXCEL,也可以,
导出 数据到C:\authors.xls, 若文件存在则重写文件, 不存在则创建文件
  ......
今天有个学生问我调用包里面具有游标类型的输出参数,可是在用PL/SQL程序调用的时候居然报出参数个数或类型错误的异常信息,于是自己也试了一下,果然是出错了。然后就自己琢磨了一下、查查资料和问问同事,原来问题是很简单的,先看一下程序的结构代码:
CREATE OR REPLACE PACKAGE Pkg_S ......
如何远程判断Oracle数据库的安装平台
select * from v$version;
查看表空间的使用情况
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_name;
SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES ......
Questions
I have a simple app that
uses an SQL Express 2005 database. When the user closes the app, I want
to give the option to back up the database by making a copy in another
directory. However, when I try to do it, I get "The process cannot
access the file '...\Pricing.MDF' because i ......