Home > database >  A record of a property has multiple values, such as how to design the database field?
A record of a property has multiple values, such as how to design the database field?

Time:09-22

Recently wrote a user attention crawlers, need the data to the database,
To the user's primary key, the attention of the user as an attribute, so that under this attribute may have hundreds of its focus on the user name, or hundreds of value
How to design such a database? thank you

CodePudding user response:

Simply provide a train of thought, will your users and focus on building the crawler table, then use the select user, wm_concat (attention (user)) from table group by the user,
So you can record user and attention to a day, the query results as an insert statement inserts, involves the new table, the table structure field, and so on

CodePudding user response:

Together is very convenient, just a query in the future, may be very troublesome,

CodePudding user response:

From a relational database, this table only need two fields username and focus on the user name, a user name can correspond to many focus on the user name,
For don't understand, so I don't know whether this table can line
  • Related