Home > database >  Consult a SQL structure column
Consult a SQL structure column

Time:12-12

Have a spare parts list, tens of thousands of records, there are dozens of properties and every parts,
Now has a set of complex logic to these parts assigned to 100 people to manage,
Requirements: to find out all parts information, and at the far right column shows the administrator
I can think of is to be 100 times the query, then union all

Is there no way is more appropriate?

CodePudding user response:

First you tell me about the complex logic

CodePudding user response:

Each component types, which corresponds to the people, get a middle table to manage,
In this way, the parts list associated with the middle table just came out, not what the union,

CodePudding user response:

Do a side-by-side comparison, each part corresponding to the attribute specifies the administrator, the Union is not appropriate, if some of the attributes in manager you need to change the code

CodePudding user response:

Didn't say clear requirements, this 100 what is the relationship of individual and parts, the final complex logic to a middle table
  • Related