I have a customers table that houses contacts. Each contact is added as another row to that customer.
I want to create my query so that I can create columns for contact1
, contact2
, contact3
and so forth. What's the best way to do this?
My rows are dynamic and I have been looking into unpivot and pivot but I'm not sure how I would build that into my query as I have a few joins and other data in the query.