sqlite 获取用户消息列表多表查询语句

很少写多表查询的语句,请教宏利得到的

select m.msg as msg_content, m.type as msg_type, m.time as msg_time, m.state as msg_state, m.has_read as has_read, u.id as friend_user_id,u.name as friend_user_name,u.avatar as friend_user_avatar from message as m, user as u where m.user_id = ? and m.friend_user_id = u.id group by m.friend_user_id order by m.time desc

相关推荐