我怎样才能加入这两个表中一列中的记录相同但字段名称不同的这两个表? [英] How can I join these two tables where the records in one column of both tables are the same but their field names were both different?

查看:58
本文介绍了我怎样才能加入这两个表中一列中的记录相同但字段名称不同的这两个表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表,即tblpip和tbluse。 tblpip具有以下字段名称:fldid,fldname,fldcity。在tbluse上:user_id,job。我想加入这两个表,其中fldid等于user_id。有什么帮助?

解决方案

  SELECT  *  FROM  tblpip  / *  或者更确切地说是要公开的特定列* /  
JOIN tbluse ON tblpip.fldid = tbluse.user_id;


您好,



写下面的查询



< pre lang =SQL> tblpip t1选择 t1.fldname,t1.fldcity,t2.job 内部 加入 tbluser t2 t1.fldid = t2.user_id


I have two tables namely tblpip and tbluse. tblpip has the following field names: fldid, fldname, fldcity. While on tbluse: user_id, job. I want to join these two tables where fldid is equal to user_id. Any help?

解决方案

SELECT * FROM tblpip /* or rather the specific columns you want to expose */
JOIN tbluse ON tblpip.fldid = tbluse.user_id;


Hi,

Write below query

Select t1.fldname,t1.fldcity,t2.job from tblpip t1 inner join tbluser t2 on t1.fldid = t2.user_id


这篇关于我怎样才能加入这两个表中一列中的记录相同但字段名称不同的这两个表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆