MYSQ问题?

hot2bot 2004-01-28 10:18:01
How can i show data like this with 2 table as bellow?

name phone categoryid
kent 123 teacher
dav 222 teacher
wen 444 worker




A Table
name phone categoryid
kent 123 1
dav 222 1
wen 444 3

B Table
categoryid categoryname
1 teacher
2 student
3 worker


...全文
18 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
简叔 2004-01-29
  • 打赏
  • 举报
回复
select a.name,a.phone b.categoryname
from a, b
where a.categoryid = b.categoryid;

Advice: Think it yourself before you send a new topic

56,679

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧