sql语句查两张表,两张表里有相同的列 ,这俩列怎么区别是那个表的

pwopwo 2011-11-11 03:54:29
select a.ssgdgx , a.gh, a.dj, a.xh, b.xh, b.tggg, b.yt, b.jgdate, b.nbid from
table1 a, table2 b where a.dgid = b.id and ssgdgx like '%X0001455@%'

这是两张表 table1 和表 table2
根据条件查出内容后 有两列是 xh , 想知道用什么方法可以将这俩列区分开
...全文
94 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yixilan 2011-11-11
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 pwopwo 的回复:]
谢了美女,
[/Quote]
败客气。
pwopwo 2011-11-11
  • 打赏
  • 举报
回复
谢了美女,
yixilan 2011-11-11
  • 打赏
  • 举报
回复
--给查出来的字段加别名:
select a.ssgdgx , a.gh, a.dj,
a.xh as a_xh, b.xh as b_xh, b.tggg, b.yt, b.jgdate, b.nbid from
table1 a, table2 b where a.dgid = b.id and ssgdgx like '%X0001455@%'

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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