/* Run this query in CD1 and compare it to the result of CD2 view_accounts. CD1 uses globalized IDs, but CD2 does not. The RIGHT() function is a fairly portable way to get short account ids from the CD1. Right 7 characters will suffice if you have fewer than 10 million accounts. MySQL removes leading zeroes after getting the right 7 digits. Other engines may. - Sam T */ SELECT a.canvas_id AS id , a.name , a.depth , a.workflow_state , a.parent_account , RIGHT(a.parent_account_id,7) , a.grandparent_account , RIGHT(a.grandparent_account_id,7) , a.root_account , RIGHT(a.root_account_id,7) , a.subaccount1 , RIGHT(a.subaccount1_id,7) , a.subaccount2 , RIGHT(a.subaccount2_id,7) , a.subaccount3 , RIGHT(a.subaccount3_id,7) , a.subaccount4 , RIGHT(a.subaccount4_id,7) , a.subaccount5 , RIGHT(a.subaccount5_id,7) , a.subaccount6 , RIGHT(a.subaccount6_id,7) , a.sis_source_id FROM canvas_data.account_dim a ;