sql 怎么写???
TB1
SQL code:
ID DATE
1 2009年1月
2 2009年12月
3 2009年3月
4 2009年6月
5 2009年2月
6 2009年3月
7 2009年6月
查询id 在 3,4,5,6,7 范围内 所有 date 得到:2009年3月,2009年6月,2009年2月
SQL code:
select distinct date from tb1 where id in (3,4,5,6,7)
SQL code:
select date from between id 3 and 7
SQL code:
select distinct date from tb1 where id in (3,4,5,6,7) order by date
select distinct date from tb1 where id between 3 and 7 order by date
select distinct Date from TB1 where id in(3,4,5,6,7)
不是
执行结果 在一个单元格内
SQL code:
结果
date
--------------------------------
2009年3月,2009年6月,2009年2月
结果在一个单元格内,最好日期排序,如下
SQL code
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
相关问答:
小弟是个新手 现在有个问题一直不能解决
例如
procedure produce_proc
@p001 nvarchar(8000),
@p002 nvarchar(8000),
@p003 nvarchar(8000),
& ......
with adod_dict do
begin
close;
commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......
执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......
情况是一张表(T)内,每条记录有一个类型字段,当按类型字段来分类查询并分页处理时
(表T内的类型是指向另一张类型表的一个ID值)
我想到了两种方式;
环境:PHP+MYSQL
1、PHP 先执行一条查询得到 ......
我数据库是MSSQL的,昨天所有的表被注入JS脚本代码,有个不明白的地方来问问大家
我发现有些表我根本没使用,也没有入库的ASP页面和语句,它是咱个注入的呢?
貌似select语句是可以嵌套的吧?
可能是where ......