一张表的某列值为另一张表的某列值之和
来源:互联网 发布:如何做淘宝客网站 编辑:程序博客网 时间:2024/05/18 02:08
SELECT t1.contractNo,t1.name,t1.signatory
,t1.signTime,t1.projectNo,t1.totalPrice
,t3.compuPrice
,t1.deliveryTime,t1.clearingForm,t1.shippingType
,t1.freightDueTo,t1.realDeliveryTime,t1.realClearingForm
,t1.payment,t1.payTime,t1.balance,t1.opAdd,t1.opConfirm
from inf_contract t1,
(SELECT SUM(t2.purchasePrice) AS compuPrice, t2.contractNo FROM list_purchase t2 GROUP BY t2.contractNo) t3
WHERE t1.type = :type
AND t1.contractNo=t3.contractNo
,t1.signTime,t1.projectNo,t1.totalPrice
,t3.compuPrice
,t1.deliveryTime,t1.clearingForm,t1.shippingType
,t1.freightDueTo,t1.realDeliveryTime,t1.realClearingForm
,t1.payment,t1.payTime,t1.balance,t1.opAdd,t1.opConfirm
from inf_contract t1,
(SELECT SUM(t2.purchasePrice) AS compuPrice, t2.contractNo FROM list_purchase t2 GROUP BY t2.contractNo) t3
WHERE t1.type = :type
AND t1.contractNo=t3.contractNo
0 0
- 一张表的某列值为另一张表的某列值之和
- 一张表的某列值去更新另一张表的某列值。
- SQL从一张表的某个字段更新为另一张表的字段
- 由一张表的内容UPDATE到另一张表
- 复制mysql数据库的一张表到另一张表
- oracle 把一张表的数据放入另一张表
- mysql 一张表的数据存入另一张表
- 根据一张表去更新另一张表的数据
- SQL使用一张表的数据更新另一张表
- 查询一张表的数据去更新另一张表
- mysql插入一张表里的数据到另一张表
- sqlserver怎么copy一张表为另一张表
- mybatis中当一张表关联另一张表时需要注入另一张表的id
- 一张表替换另一张表
- mysql 一张表update另一张表
- 查询一张表的一个字段数据,修改另一张表的字段数据
- MySql中用一张表的数据更新另一张表的部分数据
- MySQL数据库中,将一张表的数据插入到另一张表的各种情况
- Objective-C的陷阱与缺陷
- 我的学习之旅(26)system.h
- $GLOBALS['HTTP_RAW_POST_DATA'] 和$_POST的区别
- 孤岛能源安卓游戏源码
- [设计模式]-视频编码器接口设计(C版本)
- 一张表的某列值为另一张表的某列值之和
- No suitable driver sqlite tomcat 驱动
- java发送http请求
- Linux下MySQL忘记密码的破解方法
- 我的学习之旅(27)io.h
- Linux poll机制精彩分析
- Android自动化测试:获取当前前台应用的Activity名字
- android studio 用release签名进行debug
- Windows内核对象句柄的继承小总结