Hi,
As I understand, you can create a CTAS (Create Table As Select) statement by referencing the profile snapshot table and applying the required conditions. Please update the identity value as needed for your specific use case. This approach will provide all segment IDs associated with each profile. If you also need the segment names, you can join this table with the segment definition snapshot table.
The following query extracts the email address and associated segment IDs from the profile snapshot table:
select email, key from(
SELECT workEmail.address as email ,EXPLODE(segmentMembership.ups)
FROM profile_snapshot_export_* ))