mysql查询两张表

yingdafeng1 2012-02-16 01:44:02
有两张表:(devices和organization)
devices主要有以下几个字段(title、description、coding...)
organization主要有以下几个字段(coding、orgname...)
问题:通过coding字段查询列出title、description、orgname三个字段的参数
...全文
292 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
叶子 2012-02-16
  • 打赏
  • 举报
回复

select a.title ,
a.description ,
b.orgname
from devices a
full join organization b on a.coding = b.coding
parallelbgls 2012-02-16
  • 打赏
  • 举报
回复
select devices.title,devices.description,organization.orgname from devices,organization where devices.coding=organization.coding and devices.coding=...
dengsilinming 2012-02-16
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 q806294478 的回复:]
select a.title,a.discription,b.orgname from devices a,organization where a.coding=b.coding
[/Quote]

不仅在别名中少写了一个b,而且把a.description误写为a.discription了。正确的查询应该为:
select a.title,a.description,b.orgname from devices a,organization b where a.coding=b.coding
roguemaster 2012-02-16
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 q806294478 的回复:]

select a.title,a.discription,b.orgname from devices a,organization where a.coding=b.coding
[/Quote]


别名中少了个b吧
q806294478 2012-02-16
  • 打赏
  • 举报
回复
select a.title,a.discription,b.orgname from devices a,organization where a.coding=b.coding

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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