Database query corresponding foreign key value display problem

Database query corresponding foreign key value display problem
Directly use (select foreign key value from foreign key table where main table. Field = foreign table. Field) to nest in.
Such as the following example:

<!-- 用户列表 -->
	<select id="findUser" parameterType = "user"  resultType = "user">
	select account,
	username,
	head_src,
	(select userstatus from user_status where id = user_info.userstatus) as userstatus
	from user_info
	</select>

user_info table: User_info table here: insert picture descriptionuser_status table:
Spring

Guess you like

Origin blog.csdn.net/weixin_41905320/article/details/102617478