Commonly used SQL

xiaoxiao2021-03-06  42

- for: Query Lot HISTORY

--When to use: if you are Tracing bug in Production Database, this SQL CAN HELP You to TRACE The Activity of The Lot.

Select T.Activity, H.GrouphistKey, Sh.Handle, Substr (Sh.Stepid, 1, INSTR (SH.STEPID, '.') - 1),

H. LastLocation, H.lotquantity, T.TxntimeStamp, T.Userid, C.Briefscription, C.commentCode, T. *

From fwwiptransaction t, fwwiPhistory h, fwiphistory_n2m hn, fwipstephistory sh, fwcomment c

Where t.wipid = 'agza1f4c0090.01' and h.wiptxn ( ) = t.sysid

And h.sysid = hn.fromid ( ) and hn.toid = sh.sysid ( ) and c.sysid ( ) = T.TXNComment

Order by t.txntimestamp desc

转载请注明原文地址:https://www.9cbs.com/read-51793.html

New Post(0)