使用一个单元格引用另一个数据库并将两者组合在查询中
我试图弄清楚是否有一种方法可以获取单元格中的值并将其替换为该数字在另一个表中引用的用户的文本名称。
我已经查看了子查询,但我认为这不是我想要的。例如,我的查询现在返回为用户 ID、州、国家/地区。还有另一个表有 userID、name。我想查询第一个数据库,但将 userID 替换为另一个表中相应的名称。
这可行吗?我正在使用 mySQL Workbench 进行查询。
I am trying to figure out if there is a way to take the value in a cell and replace it with the text name of a user that that number refers to in another table.
I have looked through subqueries but I don't think that is what I want. So for example my query comes back now as userID, state, country. And there is another table that has userID, name. I want to query the first database but to have userID replaced with its corresponding name from the other table.
Is that doable? I am using mySQL Workbench to make my queries.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我明白你需要什么,你可以尝试这个(备份后!!)
如果你只需要从两个表中获取结果,你可以使用
If I understand what you need you could try this (after a backup!!)
If you just need to get results from two tables you could use
像这样?
Like this?