I have a setup shown below.
On my webpage, we are looking at DOCUMENT #83156. The user made multiple entries in the document. I will have thousands of these DOCUMENT numbers, and some may have no entries, and some may have 20 entries of Item/Changes. Each "entry" into my database is according to a document number.
In this example the user made 4 changes to the document. I'm trying to store all of these changes into a single entry (or per document number).
I DO NOT want to have duplicate numbers of the DOCUMENT # (meaning I do not want 4 separate entries in my database for this example).
Does anyone know how to achieve this with MySQL? I've heard that MongoDB has a simple way of doing this. I have zero experience with MongoDB, but if it would be easier I might take a look into it.
Any advice is greatly appreciated.
select distinct ...
? However, note that storing multiple distinct bits of data in a single record/field, the way you want, is considered bad practice in databases. Every unique bit of data should have its own field/record, so that the DB can easily associate it to other things. When you smoosh multiple things into a single field/record, you remove that associative ability, which somewhat negates the purpose of using an associative database in the first place. – Marc B