Understanding what this CTE is saying with REPALCE and CONCAT

I just need help confirming exactly what this piece of code is saying so I can tidy it up:
uncoveredAccountIDs as (

SELECT DISTINCT guid,

REPLACE(CONCAT(resourceId, resourceType), 'account', '') as account_id,

CASE WHEN resourceId = 'account' OR resourceType = 'account' THEN 'account' END as account

from unnestPermissions

),

image

1 Like