SQL - All Active addresses for the customer

SELECT A.CUST_ID,A.BO_ID ,D.CM_ID,D.CM_CONCAT
FROM PS_BC A, PS_BO_CM_USE B , PS_BO_CM C, PS_CM D
WHERE A.BO_ID=B.BO_ID
AND B.BO_ID=C.BO_ID
AND C.CM_ID=D.CM_ID
AND C.CM_TYPE_ID=1
AND B.PROFILE_CM_SEQ=C.PROFILE_CM_SEQ
AND B.CM_USE_END_DT>=GETDATE()

No comments:

Post a Comment