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/