这条SQL语句要怎么写

leiyingw leiyingw 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
现有两张表
主表table1有字段id ,port1,port2,port3
参数表para字段为:port_no,port_name
我写的语句为
select
a.id,
b.Port_name as port1,
b.port_name as port2,
b.port_name as port3
from table1 as a,para as b
where a.port1=b.port_no
and a.port1=b.port_no
and a.port1=b.port_no
但是查询出来的结果不对,请问为什么?要怎么写才对呢?
...全文

相关推荐

评论 10
收藏 已收藏
分享
返回顶部
leiyingw
MS-SQL Server 34,876 成员 254,635 内容