个人观点,如有错误,欢迎批评指正!
1、插入insert 和更新 update 双剑合璧为 upsert into(跟新插入) ,有数据时执行更新,无数据时执行插入,所以逐按字段插入(是否需要指定主键?)
2、只支持union all ,不支持union ,所以连接子集不能自动去重,那我们就手动,使用使用union all之后再对字段distinct可以实现去重,一行数据个字段数据完全相同才会被去重
3、union all 与order by,之前有聊过。
持续跟新中。。。
个人观点,如有错误,欢迎批评指正!
1、插入insert 和更新 update 双剑合璧为 upsert into(跟新插入) ,有数据时执行更新,无数据时执行插入,所以逐按字段插入(是否需要指定主键?)
2、只支持union all ,不支持union ,所以连接子集不能自动去重,那我们就手动,使用使用union all之后再对字段distinct可以实现去重,一行数据个字段数据完全相同才会被去重
3、union all 与order by,之前有聊过。
持续跟新中。。。