Hello,
I have a large table which contains details of contacts with different companies. However it's not in a normalised state. So instead of having one row to one contact- I have one row to each company and then multiple contacts listed. I need to know how to write some sql to convert the table to the new layout so that I can normalise the database.
ID Name Email1 Name1 Email2 Name2 DateIn 1 a@a.com a b@a.com b c@a.com c 24/06/2022
So I want the above to become-
ID Name 1 a@a.com a 2 b@a.com b 3 c@a.com c
How can I convert this sequel to achieve this outcome?-
SELECT Table1.[ID], Table1.[Email], Table1.[Name], Table1.[Email1], Table1.[Name1], Table1.[Email2], Table1.[Name2], Table1.[DateIn]
FROM Table1;
The ID is an autonumber.