darklinboxs 2018-01-03 02:41 采纳率: 0%
浏览 4275
已采纳

sql 语句优化,将2行查询结果合并到一行。

select emp_chg_other.s_name,project_table.project_name from kc_billhead,project_table,emp_chg_other,hr_epm_station,fg_ogm_station where kc_billhead.tr_proj=project_table. pc and project_table.pc=emp_chg_other.chg_data and emp_chg_other.emp_id=hr_epm_station.ccode and hr_epm_station.station=fg_ogm_station.cno and hr_epm_station.station='0106' and kc_billhead.billno='CGRK20180102001';

图片说明

  • 写回答

16条回答

  • MrFzy 2018-01-03 15:39
    关注

    有一种死办法,concat(字段1,字段2)
    具体写法 select concat((select 字段A from 表 where 条件=第一行),(select 字段A from 表 where 条件=第二行));这样即可

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

报告相同问题?

悬赏问题

  • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
  • ¥15 (关键词-电路设计)
  • ¥15 如何解决MIPS计算是否溢出
  • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
  • ¥15 操作系统相关算法中while();的含义
  • ¥15 CNVcaller安装后无法找到文件
  • ¥15 visual studio2022中文乱码无法解决
  • ¥15 关于华为5g模块mh5000-31接线问题
  • ¥15 keil L6007U报错
  • ¥15 webapi 发布到iis后无法访问