SQL语句总结

1.将A表中的一个或多个字段插入B表:

insert into tb_orgstruct(product_id,product_name,product_parent_id) SELECT DICTIONARIES_ID,NAME,PARENT_ID from sys_dictionaries

2.mybatis对表格某列求和:

1
2
3
4
5
6
<select id="findPrjNumInputByPoName" parameterType="page" resultType="Float">
        select COALESCE(SUM(ACTUAL_INPUT),0)    "prjNumInput" from
        <include refid="tableName"></include>
        where
            PO = #{NW_PO_NAME}
    </select>

 

posted @   梦里南柯  阅读(181)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示