橙稚 2017-04-14 01:02 采纳率: 33.3%
浏览 785
已采纳

sql语句查询语句问题,

SELECT CESHIXIANGMUMINGCHENG AS "国民",JIANCESHIJIAN AS "动脉硬化",ZONGHEPINGFEN AS "亚健康",BAOGAOURL AS "体成分",FPPGJIROULIANG AS "体成",CSSCDZZY AS "平衡",
CEDINGBUWEI AS "骨密度",SHUZHANGYA AS "血压计",CESHIFANGFA AS "心肺",BTGJXISHUZHI AS "平衡仪",KANGYANENGLI AS "精神" FROM t_users
RIGHT OUTER JOIN t_datacenter ON t_datacenter.HUIYUANHAO = t_users.HUIYUANHAO
RIGHT OUTER JOIN t_tichengfen ON t_tichengfen.HUIYUANHAO = t_users.HUIYUANHAO
RIGHT OUTER JOIN t_dongmaiyinghua ON t_dongmaiyinghua.HUIYUANHAO = t_users.HUIYUANHAO
RIGHT OUTER JOIN t_gonglvche ON t_gonglvche.HUIYUANHAO = t_users.HUIYUANHAO
RIGHT OUTER JOIN t_gumidu ON t_gumidu.HUIYUANHAO = t_users.HUIYUANHAO
RIGHT OUTER JOIN t_pinghengyi ON t_pinghengyi.HUIYUANHAO = t_users.HUIYUANHAO
RIGHT OUTER JOIN t_pinghengyigaoduan ON t_pinghengyigaoduan.HUIYUANHAO = t_users.HUIYUANHAO
RIGHT OUTER JOIN t_tichengfengaoduan ON t_tichengfengaoduan.HUIYUANHAO = t_users.HUIYUANHAO
RIGHT OUTER JOIN t_xueyaji ON t_xueyaji.HUIYUANHAO = t_users.HUIYUANHAO
RIGHT OUTER JOIN t_yajiankang ON t_yajiankang.HUIYUANHAO = t_users.HUIYUANHAO
RIGHT OUTER JOIN t_jingshenyali ON t_jingshenyali.HUIYUANHAO = t_users.HUIYUANHAO
WHERE t_users.HUIYUANHAO="000850"

但是t_datacenter表中,会员号000850是有数据的,就是查不出来。
还是这个链接不行!!

  • 写回答

3条回答 默认 最新

  • chaoguoguo 2017-04-14 09:30
    关注

    右连接以 right join 后的表为主 也就是 t_datacenter 为主, 既然 t_datacenter 有会员号000850是有数据的,你where 条件跟的是 t_users ,结果查不出数据,说明 t_users 这个表没有 000850 这个数据的, 换成 where t_datacenter.HUIYUANHAO="000850" 应该可以 右连接以右表为主

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥50 关于#html5#的问题:H5页面用户手机返回的时候跳转到指定页面例如(语言-javascript)
  • ¥15 无法使用此凭据登录,因为你的域不可用,如何解决?(标签-Windows)
  • ¥15 yolov9的训练时间
  • ¥15 二叉树遍历没有报错但无法正常运行
  • ¥15 在linux系统下vscode运行robocup3d上场球员报错
  • ¥15 Python语言实验
  • ¥15 SAP HANA SQL 增加合计行
  • ¥20 用C#语言解决一个英文打字练习器,有偿
  • ¥15 srs-sip外部服务 webrtc支持H265格式
  • ¥15 在使用abaqus软件中,继承到assembly里的surfaces怎么使用python批量调动