甲骨文:
select j.Jobname,rg.Region,wc.Status from Job j,Region rg,Weekend_Check_Detail wc
where j.Row_id=wc.Job_ID and Region_ID=rg.Row_id
and trunc(wc.StartTime)=trunc(sysdate)
order by rg.Region
trunc(wc.StartTime)=trunc(sysdate)
我如何在sqlserver 2008中编写与上面相同的内容?
答案 0 :(得分:2)
您可以使用Convert
功能
前:
select CONVERT(date, getdate())
或在你的情况下
select j.Jobname, rg.Region, wc.Status
from Job j,
Region rg,
Weekend_Check_Detail wc
where j.Row_id = wc.Job_ID
and Region_ID = rg.Row_id
and CONVERT(date, wc.StartTime) = CONVERT(date, getdate())
order by rg.Region