在表A中,我得到了这两个字段:
user_level,用户名
在表B上,我得到了这两个字段:
用户名,备注
我想使用mysql查询从level_id = 4的所有用户名中获取注释。
要实现这一点,数据库连接看起来会是什么样子?
提前感谢
发布于 2011-04-26 15:50:25
SELECT * FROM `A` JOIN `B` USING(`username`) WHERE `user_level` = 4;发布于 2011-04-26 15:51:50
SELECT notes FROM B b INNER JOIN A a ON (b.username = a.username) WHERE a. user_level = 4
发布于 2011-04-26 15:50:17
Select username, notes from B inner join A on a.username=b.username where user_level=4
https://stackoverflow.com/questions/5787418
复制相似问题