neil1225
neil1225
2016-04-29 05:25

怎么在SQL语句中再加一个字段呀!

String sql = "select tab.nid,tab.tid,tab.pdate,tab.psysdate,tab.pprice,tab.prodname,"
+ "tab.auditstatus,tab.pnumber,tab.zprice,tab.companyId,tab.sno,tab.soeno,tab.provname from "
+ "(select n.id nid,t.id tid,n.P_DATE pdate,n.P_SYS_DATE psysdate,sum(t.P_PRICE) pprice,"
+ "s.PRODNAME prodname,n.AUDIT_STATUS auditstatus,sum(t.P_NUMBER) pnumber,"
+ "sum(Z_PRICE) zprice,n.COMPANY_ID companyId,s.no sno,s.oeno soeno,jtp.provname provname "
+ "from jxc_t_purchase as n "
+ "right join jxc_t_purchase_detail as t on t.P_PURCHASE_ID=n.id "
+ "left join jxc_t_products as s on s.id=t.P_WARES_ID "
+ "left join jxc_t_providers jtp on s.PROVIDER_ID = jtp.id "
+ "group by n.id desc ) tab where 1=1";怎么再加一个type字段呀!

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答