zoukankan      html  css  js  c++  java
  • SQL 语句 之 增删改查 (一)

    本语句基于Microsoft SQL Server

    --Insert From Selecter
    Insert into DTOClass (F1,F2,F3) select T2.F1,T2.F2,T2.F3 from DTOClass2 T2 where t2.F1='xx'

    --删、改、查语法一致
    Delete from DTOClass from DTOClass T1,DTOClass2 T2 where T1.F1=T2.F1 and T1.F2=T2.F2 and T2.F3 = 'XX'
    Delete from DTOClass from DTOClass T1 inner join DTOClass2 T2 on T1.F1=T2.F1 and T1.F2=T2.F2 where T2.F3 = 'XX'

    --Set 左侧没有Alias
    Update DTOClass Set F3='F3_xx' from DTOClass T1,DTOClass2 T2 where T1.F1=T2.F1 and T1.F2=T2.F2 and T2.F3 = 'XX'
    Update DTOClass Set F3=T2.F3 from DTOClass T1 inner join DTOClass2 T2 on T1.F1=T2.F1 and T1.F2=T2.F2 and T2.F3 = 'XX'

    Select T1.F1,T1.F2,T2.F1,T2.F2 from DTOClass T1,DTOClass2 T2 where T1.F1=T2.F1 and T1.F2=T2.F2 and T2.F3 = 'XX'
    Select T1.F1,T1.F2,T2.F1,T2.F2 from DTOClass T1 inner join DTOClass2 T2 on T1.F1=T2.F1 and T1.F2=T2.F2 and T2.F3 = 'XX'



  • 相关阅读:
    软考
    码云
    vue和bpmnjs
    工作流引擎
    net core restapi
    工厂模式
    sqlmanage
    类的扩展
    导出excel
    拼图
  • 原文地址:https://www.cnblogs.com/vjine/p/2283368.html
Copyright © 2011-2022 走看看