Advertisement
byattack

Microsoft SQL Server Management Studio

Feb 9th, 2012
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. select *
  2. ---into xrevtemp
  3. FROM
  4. DORIG
  5.  
  6. JOIN (SELECT
  7. [tipodoc]
  8. ,[numerodoc] as numerodocpf
  9. ,[datadoc] as datadocpf
  10. ,[codicecf]
  11. ,[codicearti]
  12. ,[u_rev]
  13. ,U_SQLCODE
  14. FROM [AMK_AGTRADING]...[docrig] DOCRIG
  15. JOIN Xamk_docana ON DOCRIG.TIPODOC=XAMK_DOCANA.codice where u_rev !='0' and u_rev!='' and u_rev like '%[0-999]%') S ON DORIG.Cd_AR=S.CODICEARTI AND S.NUMERODOCpf=DORIG.NumeroDoc AND S.DATADOCpf=DORIG.DataDoc and dorig.Cd_DO=s.u_sqlcode and u_rev !='' and u_rev !='0' and dorig.Cd_CF=LEFT(s.codicecf,1)+'0'+RIGHT(s.codicecf,5)
  16. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement