查詢及更新邊角廢料明細與總計 SQL

2021-06-02 05:14:08 字數 469 閱讀 7244

--update trs.inv_info set inv_qty=b1.qty

select a.item_no,a.inv_qty,b1.qty

from trs.inv_info a,(

select b.detail_item,sum(a.head_mark*b.detail_net) qty

from trs.inv_head a,trs.inv_detail b

where a.head_no=b.head_no

--and b.detail_item='a02'

and a.head_status='p'

group by detail_item

) b1 where a.item_no=b1.detail_item

and a.inv_qty!=b1.qty

order by a.item_no

使用 JdbcTemplate 查詢及更新資料庫

通過對 jdbctemplate 源 的研讀,可以看到,在 jdbctemplate 提供了很多用來查詢的數 據庫,比如 queryformap queryforlong queryforint queryforlist 等等。這裡只是簡單的進行示例說明,使用 queryforlist 查詢的示例 ...

es curl 查詢與更新及批量操作

1,封裝http方法 2.查詢呼叫 索引 index name apt result md5 ip es的ip port 埠 9200 查詢條件 3.更新呼叫 index name type id 索引 型別 id update doc 更新字段 arr 4.批量操作 param id 需要修改的i...

線段樹的建立 查詢 更新及應用

線段樹本質上是一棵二叉搜尋樹 體現在查詢階段 與普通的二叉樹不一樣,這個二叉樹有點特別 用left和right來表示乙個區間,即 left,right 而其值val,則用來表徵這個區間的某些特徵,例如 區間最大值,區間最小值,區間和 並且容易知道,當left和right相等時,代表葉結點,其值就是某...