6 个解决方案
#1
select * from B where (select 代码 form A )=代码
#2
select *
from B
where B.代码 = (select a.代码 form A );
from B
where B.代码 = (select a.代码 form A );
#3
不对啊,我的意思是用A表的名称代替B表里的代码。
比如B表里有个学生类型的字段,填的是类型代码,我检索出来的记录想用类型代替类型代码来显示。
比如B表里有个学生类型的字段,填的是类型代码,我检索出来的记录想用类型代替类型代码来显示。
#4
select A.名称,B.代码.....
from A,B
where B.代码 = a.代码
from A,B
where B.代码 = a.代码
#5
select A.名称,//在这两个表里你想得到的字段
from A,B
where B.代码 = a.代码
from A,B
where B.代码 = a.代码
#6
这样是可以,可后面where B.代码 = a.代码就限制显示的记录条件了,就不是所有的记录啦。
#1
select * from B where (select 代码 form A )=代码
#2
select *
from B
where B.代码 = (select a.代码 form A );
from B
where B.代码 = (select a.代码 form A );
#3
不对啊,我的意思是用A表的名称代替B表里的代码。
比如B表里有个学生类型的字段,填的是类型代码,我检索出来的记录想用类型代替类型代码来显示。
比如B表里有个学生类型的字段,填的是类型代码,我检索出来的记录想用类型代替类型代码来显示。
#4
select A.名称,B.代码.....
from A,B
where B.代码 = a.代码
from A,B
where B.代码 = a.代码
#5
select A.名称,//在这两个表里你想得到的字段
from A,B
where B.代码 = a.代码
from A,B
where B.代码 = a.代码
#6
这样是可以,可后面where B.代码 = a.代码就限制显示的记录条件了,就不是所有的记录啦。