求一SQL语句,马上给分!!! A表中有一个字的格式是这样的(用逗号分隔开,可能有1个到5个ID):",02,26,50, "这个字段跟B表的ID对应,B表的段有(ID,Name),现在想用一SQL将A表中的编号换成B表对应的名称显示出来,请问怎么写,谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我想要的是查询A表的所有内容,但要用B表的name来代理显示“,02,26,50,”等ID select name from 表B where id in (select id from 表A)不知道行不行,你的表A中的ID内容有点乱! A表中有一个字段是B表ID的组合,最多有5个 比如 “01,02,03,04,05”我要在时显示出五个name,而不是查出B表的五条记录 select b.name from b where b.id in (( select top 1 left(a.id,2) from a),(select top 1 substring(a.id,4,2) from a),(select top 1 substring(a.id,7,2) from a),(select top 1 substring(a.id,10,2) from a),(select top 1 substring(a.id,13,2) from a)) 查询 mysql mysql表读取mysql表的问题 ERROR 2003: Can't connect to MySQL server on 'localhost' (10061) sql2000如何转化到mysql 请教MYSQL高手。关于二进制操作文件提取。 mysql创建存储过程问题 在mysql命令行中使用source ----------第一次用MYSQL,请各位高手帮忙看看这个错误!在线等待!------------- 请问大家 mysql 哪个版本比较稳定?5.0怎么样? 多个表的查询问题? mysql语法问题 mysql触发器问题
不知道行不行,你的表A中的ID内容有点乱!
我要在时显示出五个name,而不是查出B表的五条记录
from b
where b.id in
(( select top 1 left(a.id,2) from a),
(select top 1 substring(a.id,4,2) from a),
(select top 1 substring(a.id,7,2) from a),
(select top 1 substring(a.id,10,2) from a),
(select top 1 substring(a.id,13,2) from a))