-1

I cannot figure out how to even explain this succinctly, I suspect there is a word or term for what I want to do but I dont know it. I have a table and it has many duplicate records. each record has 5 columns.

ID (not key), Thing1, Thing2, Thing3.

ID1, ball, ring, jumprope

ID1, flower, book, bell

ID2, something, something

ID3, something, something, something

I would like to do this:

ID1, ball, ring, jumprope, flower, book, bell

ID2, something, something

ID3, something, something, something

Any pointing me to a tutorial would be useful. I just dont even know what to call this to look for a tutorial.

  • Welcome to Stack Overflow. Please take the [tour] to learn how Stack Overflow works and read [ask] on how to improve the quality of your question. Then check the [help/on-topic] to see what questions you can ask. Also see https://meta.stackoverflow.com/questions/333952/why-should-i-provide-a-minimal-reproducible-example-for-a-very-simple-sql-query for SQL related questions. Please show your attempts you have tried and the problems/error messages you get from your attempts. – Progman Jan 03 '21 at 22:06
  • Your model is likely flawed. See normalisation. – Strawberry Jan 03 '21 at 22:08
  • not my model, but definitely flawed. I will look that up thank you. – MinnieMouse Jan 03 '21 at 22:14

1 Answers1

0

if these elements are in seperate tables, you can use JOIN.

SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID
ORDER BY Customers.CustomerName;

in this example they are joining a Customers table with an Orders table, where CustumerID is the same. More details

iiSam
  • 61
  • 5