数据库问题

lou_df 2002-04-22 04:01:14
在表table1里的某个字段保存着代码,在table2中保存着代码和原文。
在语句:
select 代码字段 from table1
中,如何把上述语句改写,将列出的代码全部转换为原文?
...全文
87 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
no_com 2002-04-22
  • 打赏
  • 举报
回复
select table2.原文 其他字段 from table1,table2 where tabl1.代码=table2.代码
lou_df 2002-04-22
  • 打赏
  • 举报
回复
可能没有说清楚。
select 代码字段,其他字段1,其他字段2,... from table1 产生如下结果:
123 abc ...
234 cde ...
345 dfr ...
我想它产生下面的结果:
中国(注:代码为123) abc ...
美国(注:代码为234) cde ...
德国(注:代码为345) dfr ...
如何实现?
lovingkiss 2002-04-22
  • 打赏
  • 举报
回复
inner join是联结一个或多个表的东东,好好学习一下用法;对编程比较有帮助;而且,用好数据库自带的SQL语句生成器,很罗嗦的代码就交给它拉
Access2000、SQLServer都有的。。。。。。
lovingkiss 2002-04-22
  • 打赏
  • 举报
回复
select tabl1.代码 As 代码1,table2.代码,table2.原文 from table1 inner join table2 on tabl1.代码=table2.代码

zzq3197 2002-04-22
  • 打赏
  • 举报
回复
select table2.原文 from table1,table2 where tabl1.代码=table2.代码

jswxcathay596200 2002-04-22
  • 打赏
  • 举报
回复
select table1.field1, table2.field1,table.field2 from table1 left join table2 on table1.field1=table2.field2
试试看吧
pl5th2001 2002-04-22
  • 打赏
  • 举报
回复
select 原文 from table1,table2 where tabl1.代码=table2.代码
zhongminsheng 2002-04-22
  • 打赏
  • 举报
回复
不明白!

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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