A B c three tables
A data sheet
b for Condition set table BID B1 B2 B3 four fields
C for User table CID UID fields
Statistics a table conforms to 3 conditions A1 A2 A3 Three conditions, these three conditions are statistical user data derived conditions.
Then the UID value updated by the user CID according to the C table
The fact is to update the value of bid with three criteria to the CID of the C table
Conditions set in table B
Bid=1 b1=10 b2=100 b3=180
bid=2 b1=30 b2=150 b3=200
bid=3 b1=50 b2=180 b3=230
Statistically good $a1 $A 2 $A 33 conditions to compare >=b table B1 B2 B3 value, and then update the bid value of the corresponding condition to the CID of table C
May I ask how this is done? Internal link But the CID of C is only equal to one of the values in table B bid.
What I'm doing now is two SQL statements, 11 queries that match the bid, and the 2nd statement updates the qualifying bid to C
Is there a way to complete a MySQL statement?
Reply to discussion (solution)
You the three tables, only to use 2 tables have corresponding related fields, in accordance with the conditions to check, it is OK, the most important thing is to have the associated field.
Currently only two statements have been completed, and the association should be less likely.