Recently need in a table according to a certain value of table B to sort out, helpless SQL technology is not enough, do not know how to connect to achieve the goal, then think of a table to add the target value of table B field, and then by updating a table so that a table has a Target field, and then ranking .... enough to tangle.
Talk less about direct culture:
The first step is to use NAVICAT to export the target field of table B to the file, I have only two fields here so in addition to the key value, the remaining is the target field.
First Open the Table dialog box and click Export:
Then select All records-text file txt-Select the columns you want to export:
Then keep on the next step and finally start. Export succeeded.
Design the table in a table, add fields, here our target field is rank
Then select the A table you want to import, click Import-Text file txt-select file-click Next until here:
Select it according to the Red circle in the figure, the ID and disease_id are one by one corresponding key values, rank is the key value you want to fill in (Here you need to first add the field in a table). Next
Check the update option, and it will begin to update automatically at the last point! Original Oh, ask for praise =. =
To update a field in a database table with Navicat