user table
single table
As shown in the figure, how to query the same records of user and user in the single table and output the id of the user table and the exam_name field of the user single table
Or how to change this table to make it better
still have a question
If you want to modify the user in the user table, how can the user corresponding to the single table be modified at the same time? I’m a newbie and I don’t understand very well. I hope my friends can help me and teach me. Thank you
phpcn_u15822017-06-23 09:13:33
select a.id,a.user,b.exam_namc from user as a join single as b on a.user = b.user
过去多啦不再A梦2017-06-23 09:13:33
No debugging
1,
select u.id, u.user, s.exam_name from user u, single s where u.user = s.user
2,
update user u,single s set u.user = '值', s.user = '值' where u.user = u.user and u.id = '条件'
某草草2017-06-23 09:13:33
To join two tables when selecting, you can check the usage of sql join.