The question now is the associative table, and then reflect the data table in the middle, first of all, this is just the absence of back-end operate front end to reflect, just in order to find out the data into the middle of table
Project list of each position=user table user name field
Project table project id field=the table in the middle of the project id field
User table user id field=the table in the middle of the user id field
Another is how to deal with the middle table to a position within the
Great god please help it, how do I write the SQL, studied several days nothing
CodePudding user response:
Did not understand your need, is you need to link to check? Or check + insert?CodePudding user response:
Look at this request, is to think through the project table and the user table to generate the intermediate tableFor example
insert into table in the middle (audit_id, user_id, audit_post)
The select a.a udit_id,
B.u ser_id,
The case when a.a udit_duty=b.n ame then '1'
The when a.a udit_headman=b.n ame then '2'
The when a.a udit_judge=b.n ame then '3'
The else '4'
End
From the project table a, user table b
Where b.n ame in (a.a udit_duty, a.a udit_headman, a.a udit_judge, a.a udit_menber);