zoukankan      html  css  js  c++  java
  • sql server里面sql语句执行update,delete操作的时候,对表用别名的写法

    sql server里面sql语句执行update,delete操作的时候,对表用别名的写法:

    update a set a.name=b.StuName from table1 a inner join table2 b on a.id=b.id;

    delete t from table1 t where
    exists(select 1 from table2 a where a.col1=t.col1 
    and a.col2=t.col2 and a.col2=100)

    下面的写法是错误的:

    update table1 a set a.name='XXX' where a.name='';

    char(9) 水平制表符

    char(10)换行键

    char(13)回车键

    1> 回车符  char(13)

    select  replace(barcode, char(13) , '<br>')  as barcode from SickInfo

    2>换行符 char(10)select *replace(barcode, char(10), '<br>') as barcode from SickInfo

    3>回车换行符 char(13)+char(10)

    select replace(barcode, char(13)+char(10), '<br>') as barcode from SickInfo

    4>在表中过滤包含回车换行符的字段barcode的记录

    select * from SickInfo where charindex(char(10)+char(13),barcode)>0

  • 相关阅读:
    Java 传递参数时,传递一个变量快还是传递一个实体类?
    13 设计模式
    12 反射
    11.多线程&&并发
    10.输入输出
    9.异常Exception
    7.正则表达式
    5.数组
    6.常见对象
    上传本地项目到Github
  • 原文地址:https://www.cnblogs.com/junior/p/2421486.html
Copyright © 2011-2022 走看看