SQL查询窗口 选择哪行执行哪行,不选择则从上到下依次执行

delete from xsxx where xsxm is null    /****** 删除所有xsxm为null的记录******/

select * from xsxx where xsxm like '张%' //显示所有姓张的记录

select  distinct tx from tiku where tx is not null//显示表中TX不空的所有不重复的TX值

 

select * from tiku where tx is not null   //显示tiku中所有TX不是NULL的所有记录信息
select REPLACE(tx,'.jpg','') from tiku where tx is not null  //显示tiku中所有TX不是NULL的所有TX去掉“.jpg"后所有信息
update tiku set tx=REPLACE(tx,'.jpg','') from tiku where tx is not null //将所有TX不是NULL的所有记录的TX值替换为”去掉.JPG"后的内容

order by convert(xsxm using gbk) desc//根据汉字拼音顺序来显示记录

 create table test2 ('a' varchar(100),'b' varchar(10), key 'k_a' ('a') ,key 'k_b' ('b'), unique key 'u_k' ('a','b'))

select count(*) from (select distinct wz from xinxi) a 统计xinxi表中所有不重复的WZ的总数(一定要起个别名)

update hnyy set ysid=replace(ysid,'\n','')替换字段中的换行再更新

insert ignore into hnyy_copy2 select replace(ksid,'\n',''),replace(ysid,'\n',''),replace(xm,'\n','') from hnyy 用另一表中去除换行符后的内容插入到另一表中

相关文章:

  • 2021-07-11
  • 2022-12-23
  • 2021-06-24
  • 2021-11-30
  • 2022-01-25
  • 2022-12-23
  • 2021-09-09
猜你喜欢
  • 2021-11-05
  • 2022-01-14
  • 2022-03-03
  • 2021-11-18
  • 2022-12-23
  • 2021-12-16
  • 2022-02-28
相关资源
相似解决方案