Home > database >  League table update SQL statement
League table update SQL statement

Time:10-21

Province table includes three fields: ID, name of the province, city name list string (separated with the city ID);
Table contains two fields in cities, respectively is ID, name of city,
Now demand is province table a list of new city ID list, could you tell me how to implement the field through two table combined UPDATE the value of the updated? Thank you very much!

CodePudding user response:

Suggest you list your table structure, and provide the test data, and based on these test data that corresponds to the correct result,
Refer to the way the post questions http://bbs.csdn.net/topics/320211382

1. You create table XXX.. Statement
2. You insert into XXX... Statement
3. The result is what kind, and give a simple algorithm description)
4. Do you use the database name and version of (often asked in MS SQL server edition MySQL)

So people who want to help you to build the same environment with you directly, and in providing the test before, avoid the error in the text understanding,

CodePudding user response:

Because the building of the city name and ID field is a comma-separated string, write a procedure or function implementation advice,
  • Related