ÏÖÓбí Term
½á¹¹ÈçÏÂ
time1 time2 idterm
2009-2-15 2009-6-30 11
2009-9-10 2010-1-15 12
Èç¹ûÊäÈë 2009-4-25 ÔòÓ¦¸ÃÈ¡³öidterm 11
Èç¹ûÊäÈë 2009-12-5 ÔòÓ¦¸ÃÈ¡³öidterm 12
Õâ¸öSQL¸ÃÔõôд£¿
·ÖÉÙÇë¼ûÁÂ
SQL code:
select idterm from tb
where time1<=ÊäÈëÈÕÆÚ and time2>=ÊäÈëÈÕÆÚ
SQL code:
declare @time datetime
set @time ='2009-4-25'
select top 1 * from term where time1<=@time and time2 >=@time
SQL code:
declare @time1 datetime,@time2 datetime
set @time1=..
set @time2=..
select idterm from tb where time between @time1 and @time2
case...when....then..
select idterm from tb
where time1 <=time2 and time2>=time1
Ïà¹ØÎÊ´ð£º
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
ÐèÇóÈçÏ£º
ѧԺ academy£¨aid,aname£©
°à¼¶ class£¨cid,cname,aid£©
ѧÉú stu(sid,sname,aid,cid)
סËÞÇø region(rid,rname)
ËÞÉáÂ¥ build(bid,rid,bnote) bnoteÊÇ¡®ÄС¯/¡®Å®¡¯
ËÞÉá dorm(did,rid,bid£¬bedn ......
±íÊý¾Ý
COL1 COL2 COL2 COL4 COL5
----------------------------------------------------------------------------------------------
2010-05-05 00:00 ......
SQL code:
rs.open "select * from guide where city_name='±±¾©' order by pai desc",conn,1,1
do while not rs.eof or rs.bof
¡£¡£
¡£¡£
¡£¡£
rs.movenext
loop
Õâ¸ösqlÓï¾äÔÚwapÕ¾Àï ±¾ÉíÓÐ ......