看看这个查询语句怎么写?

PI_2002 2002-09-04 10:02:15
我有两个表T_MAN,T_INFO。结构如下
T_MAN{name char(10),
tel char(13), --电话
add char(50) --住址
}

T_INFO{id char(12), --无重复的序号
tel char(13), --电话
long datetime,--通话长度
xm char(10), --通话人姓名
context varchar(100), --通话简要内容

现在我需要在给定 T_INFO.id 的情况下,通过一条查询语句生成如下结构的视图:
t_info.id,
t_info.tel,
t_man.name,
t_man.add,
t_info.long,
t_info.xm,
t_info.context

唯一知道的条件就是 t_info.id = '给定值'
...全文
26 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
superdev 2002-09-04
  • 打赏
  • 举报
回复
select t_info.id,
t_info.tel,
t_man.name,
t_man.add,
t_info.long,
t_info.xm,
t_info.context
from t_info,t_man
where t_info.id=给定值
and t_info.tel = t_man.tel
willyzeng 2002-09-04
  • 打赏
  • 举报
回复
select t_info.id,
t_info.tel,
t_man.name,
t_man.add,
t_info.long,
t_info.xm,
t_info.context from t_info,t_man
where t_info.tel = t_man.tel and t_info.id = '给定值'

j9988 2002-09-04
  • 打赏
  • 举报
回复
select
t_info.id,
t_info.tel,
t_man.name,
t_man.add,
t_info.long,
t_info.xm,
t_info.context
from t_man,t_info
where t_man.tel=t_info.tel
and t_info.id = '给定值'
zw_sjj 2002-09-04
  • 打赏
  • 举报
回复
select t_info.id,t_info.tel,t_man.name,t_man.add,t_info.long,t_info,xm,t_info.context from t_info,t_man where t_info.id='给定值' and t_info.tel=t_man.tel

34,590

社区成员

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

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