as of timestamp sysdate-1/12 看不懂, 如果要查表t5001 的昨天的sql 操作如何写语句? select * from t5001 as of timestamp sysdate-1/12
回lvpinging: 你试一下select sysdate-1/12 from dual就知道了,是2个小时前的时间点 回楼上的:你要查昨天的sql?什么意思啊?如果要查t5001昨天的数据的话,你先要确定要查昨天什么时候的数据。
其实我不明白的是select * from dba_source as of timestamp sysdate-1/12 句子的语法。。 sysdate-1/12 我知道意思的但是as of timestamp sysdate-1/12 能这样用。。 要是我要查a表2小时以前的数据也可以这样用? select * from a as of timestamp sysdate-1/12
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER PROCEDURE [dbo].[rpt_1] @ShipId nvarchar(20) AS BEGIN DECLARE @ShipIdDesc nvarchar(20) IF @ShipId='' BEGIN SET @ShipIdDesc='All' SET @ShipId='%' End Else BEGIN SELECT @ShipIdDesc=@ShipId; End select ShipCard.ShipId,ShipCard.SONum,ShipCard.ProNum,ShipCard.Lot,ShipCard.CardGuid, CardBarCode=CASE WHEN isnull(ShipCard.CardBarCode,'0')='0' then '' WHEN ShipCard.CardBarCode='' then '' WHEN ShipCard.CardBarCode=' ' then '' Else: ShipCard.CardBarCode end, ShipCard.CardBoxQty, ShipSO.StandardBoxQty, convert(varchar,isNull(tCount.coun1,0) )+'/'+ convert(varchar,ShipCard.CardBoxQty) as CardBoxQty_Conv, IfCompose=CASE WHEN ShipSO.StandardBoxQty=0 then 0 WHEN (ShipSO.StandardBoxQty<>0) and (ShipCard.CardBoxQty=ShipSO.StandardBoxQty) then 0 else 1 end, isNull(tCount.coun1, 0) As coun1, Ship.ShipDate, isNull(CardBox.BoxBarCode,'') as BoxBarCode from ShipCard left outer join ShipSO on ( ShipCard.ShipId = ShipSO.ShipId and ShipCard.SONum = ShipSO.SONum and ShipCard.ProNum =ShipSO.ProNum and ShipCard.Lot= ShipSO.Lot ) left outer join Ship on ( ShipCard.ShipId= Ship.ShipId ) left outer join ( select CardGuid,count(*) as coun1 from CardBox where 1=1 group by CardGuid) as tCount on (ShipCard.CardGuid =tCount.CardGuid ) left outer join CardBox on ( ShipCard.CardGuid= CardBox.CardGuid )Where 1 = 1 --- and Ship.ScanStatus='0' and ShipCard.ShipId LIKE @ShipId; End
flashquery闪回查询
如果要查表t5001 的昨天的sql 操作如何写语句?
select * from t5001 as of timestamp sysdate-1/12
回楼上的:你要查昨天的sql?什么意思啊?如果要查t5001昨天的数据的话,你先要确定要查昨天什么时候的数据。
sysdate-1/12 我知道意思的但是as of timestamp sysdate-1/12 能这样用。。
要是我要查a表2小时以前的数据也可以这样用?
select * from a as of timestamp sysdate-1/12
{
Response.Cookies["LanguageVer"].Value = txtLanguage.Value;
Response.Cookies["LanguageVer"].Expires = System.DateTime.Now.AddDays(30);
LanguageVer = txtLanguage.Value;
txtLanguage.Value = "";
string str;
str = "\n<script language=javascript>";
str += "\ntest();";
str += "\n</script>";
if(!this.IsStartupScriptRegistered("Startup"))
this.RegisterStartupScript("Startup", str);
// Page.RegisterStartupScript("Startup", "<Script Language='JavaScript'> test(); </Script>") ;
}
<SCRIPT language="javascript">
<!--
Function test()
{
top.location =top.location ;
}
//-->
</SCRIPT>
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[rpt_1]
@ShipId nvarchar(20)
AS
BEGIN
DECLARE @ShipIdDesc nvarchar(20)
IF @ShipId=''
BEGIN
SET @ShipIdDesc='All'
SET @ShipId='%'
End
Else
BEGIN
SELECT @ShipIdDesc=@ShipId;
End
select ShipCard.ShipId,ShipCard.SONum,ShipCard.ProNum,ShipCard.Lot,ShipCard.CardGuid,
CardBarCode=CASE WHEN isnull(ShipCard.CardBarCode,'0')='0' then ''
WHEN ShipCard.CardBarCode='' then ''
WHEN ShipCard.CardBarCode=' ' then ''
Else: ShipCard.CardBarCode
end,
ShipCard.CardBoxQty,
ShipSO.StandardBoxQty,
convert(varchar,isNull(tCount.coun1,0) )+'/'+ convert(varchar,ShipCard.CardBoxQty) as CardBoxQty_Conv,
IfCompose=CASE WHEN ShipSO.StandardBoxQty=0 then 0
WHEN (ShipSO.StandardBoxQty<>0) and (ShipCard.CardBoxQty=ShipSO.StandardBoxQty) then 0 else 1
end,
isNull(tCount.coun1, 0) As coun1,
Ship.ShipDate,
isNull(CardBox.BoxBarCode,'') as BoxBarCode
from ShipCard left outer join ShipSO on ( ShipCard.ShipId = ShipSO.ShipId
and ShipCard.SONum = ShipSO.SONum
and ShipCard.ProNum =ShipSO.ProNum
and ShipCard.Lot= ShipSO.Lot
)
left outer join Ship on ( ShipCard.ShipId= Ship.ShipId )
left outer join ( select CardGuid,count(*) as coun1 from CardBox where 1=1 group by CardGuid) as tCount on (ShipCard.CardGuid =tCount.CardGuid )
left outer join CardBox on ( ShipCard.CardGuid= CardBox.CardGuid )Where 1 = 1
--- and Ship.ScanStatus='0'
and ShipCard.ShipId LIKE @ShipId;
End
onclick = "SearchGama_Sale_No('txt_SONum','txt_ProNum','txt_Lot','txt_BoxQty','txt_CusNum','txt_ProQty')"
src="image/search.gif" align="absMiddle"></td><button id="btnReset2" onclick="document.all('imgSearch').disabled=false; txt_SONum.readonly=false;txt_SONum.value='';txtI.value='';txt_ProNum.value='';txt_ProQty.value='0'"
type="button" runat="server"></button>