There is a field that holds the checkbox content, such as a career target selection for database field otworkgoal, saving 1,2,3,4 content
Now you need to use the pure MySQL statement to translate the field otworkgoal content into Chinese.
Can be implemented using the Find_in_set () function +concat_ws () function.
Find_in_set () refer to Https://www.cnblogs.com/zxmceshi/p/5479892.html
Concat_ws () refer to http://blog.csdn.net/desilting/article/details/38563087
The specific SQL statements are as follows
SelectConcat_ws (',',(Select 'accumulate experience skills and resources for entrepreneurship' fromOnline_person_info QwhereFind_in_set ('1', Q.otworkgoal) andT.id=q.id), (Select 'Higher position Promotion space' fromOnline_person_info QwhereFind_in_set ('2', Q.otworkgoal) andT.id=q.id), (Select 'Better Remuneration Package' fromOnline_person_info QwhereFind_in_set ('3', Q.otworkgoal) andT.id=q.id), (Select 'more challenging job content' fromOnline_person_info QwhereFind_in_set ('4', Q.otworkgoal) andT.id=q.id), (Select 'Learn more about your professional skills' fromOnline_person_info QwhereFind_in_set ('5', Q.otworkgoal) andT.id=q.id), (Select 'a more comfortable working environment' fromOnline_person_info QwhereFind_in_set ('6', Q.otworkgoal) andT.id=q.id), (Select 'reduced working pressure' fromOnline_person_info QwhereFind_in_set ('7', Q.otworkgoal) andT.id=q.id), (Select 'Closer to work distance' fromOnline_person_info QwhereFind_in_set ('8', Q.otworkgoal) andT.id=q.id), (Select 'other' fromOnline_person_info QwhereFind_in_set ('9', Q.otworkgoal) andT.id=q.id)) asOtworkgoal fromOnline_person_info TwhereT.id=' A'
can be translated
MySQL handles field content separated by commas