Advertisement
Pandaaaa906

po_01

Feb 28th, 2021
1,586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.54 KB | None | 0 0
  1. select
  2.  
  3. t4.POID po_main_id,
  4. t3.ID po_detail_id,
  5.  
  6. t4.cPOID po_code,
  7. t2.cCode "01_code",
  8.  
  9. t2.ID arr_main_id,
  10. t1.Autoid arr_detail_id,
  11.  
  12. po_vendor.cVenName po_vendor,
  13. "01_vendor".cVenName "01_vendor",
  14. t1.cInvCode
  15.  
  16. from rdrecords01 t1
  17.  
  18. LEFT JOIN rdrecord01 t2
  19. on t1.ID=t2.ID
  20.  
  21. LEFT JOIN PO_Podetails t3
  22. on t1.iPOsID = t3.ID
  23.  
  24. LEFT JOIN PO_Pomain t4
  25. on t3.POID=t4.POID
  26.  
  27. LEFT JOIN Vendor po_vendor
  28. on po_vendor.cVenCode=t4.cVenCode
  29.  
  30. LEFT JOIN Vendor "01_vendor"
  31. on "01_vendor".cVenCode=t2.cVenCode
  32.  
  33. where t4.cVenCode!=t2.cVenCode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement