<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[luisls的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/luisls</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; luisls]]></copyright><item><title><![CDATA[EXCEL中将数字转换成中文金额大写]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/157425306</link><guid>https://blog.youkuaiyun.com/luisls/article/details/157425306</guid><author>luisls</author><pubDate>Tue, 27 Jan 2026 08:16:38 +0800</pubDate><description><![CDATA[EXCEL中大写金额]]></description><category></category></item><item><title><![CDATA[在MSSQL中将满足A条件的记录的字段值修改为满足B条件记录的值]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/155593604</link><guid>https://blog.youkuaiyun.com/luisls/article/details/155593604</guid><author>luisls</author><pubDate>Fri, 05 Dec 2025 09:11:16 +0800</pubDate><description><![CDATA[在MSSQL中，有时会遇到需要将满足A条件的记录的字段值修改为满足B条件记录的值，如下面这个例子。AND s.导出时间 < ‘2025-12-03 23:00:00’;INNER JOIN AAA s ON g.订单号 = s.订单号。AND g.订单号 IN (‘SO-25901981’)LEFT(g.单据号, 5) = ‘CCPTL’g.原币单价 = s.原币单价,g.销售单价 = s.销售单价,g.销售金额 = s.销售金额。]]></description><category></category></item><item><title><![CDATA[MSSQL中比对两个相近表字段]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/149837057</link><guid>https://blog.youkuaiyun.com/luisls/article/details/149837057</guid><author>luisls</author><pubDate>Fri, 01 Aug 2025 16:33:20 +0800</pubDate><description><![CDATA[(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ‘表A’) a。(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ‘表B’) b。ISNULL(a.COLUMN_NAME, b.COLUMN_NAME) AS 字段名,a.CHARACTER_MAXIMUM_LENGTH AS 表1长度,b.CHARACTER_MAXIMUM_LENGTH AS 表2长度,]]></description><category></category></item><item><title><![CDATA[SQL SERVER中取两年前今天的日期]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/127280936</link><guid>https://blog.youkuaiyun.com/luisls/article/details/127280936</guid><author>luisls</author><pubDate>Wed, 12 Oct 2022 13:29:21 +0800</pubDate><description><![CDATA[sqlserver获取当前日期往前几年前的日期]]></description><category></category></item><item><title><![CDATA[excel中取指定字符之间的内容]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/124169473</link><guid>https://blog.youkuaiyun.com/luisls/article/details/124169473</guid><author>luisls</author><pubDate>Thu, 14 Apr 2022 13:15:45 +0800</pubDate><description><![CDATA[excel取指定字符中间内容]]></description><category></category></item><item><title><![CDATA[替换字段中特定字符]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/121404287</link><guid>https://blog.youkuaiyun.com/luisls/article/details/121404287</guid><author>luisls</author><pubDate>Thu, 18 Nov 2021 16:37:16 +0800</pubDate><description><![CDATA[select * from prdt where prd_no like ‘219-%’ and spc like ‘%打磨%’
update prdt set name=replace(name,’、打磨’,’’) where prd_no like ‘219-%’ and name like ‘%打磨%’
update prdt set name=replace(name,’/打磨’,’’) where prd_no like ‘219-%’ and name like ‘%打磨%’
update pr]]></description><category></category></item><item><title><![CDATA[SUNLIKE中取所有进货单物品的最新供应商单价]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/117587975</link><guid>https://blog.youkuaiyun.com/luisls/article/details/117587975</guid><author>luisls</author><pubDate>Sat, 05 Jun 2021 10:21:18 +0800</pubDate><description><![CDATA[if object_id(‘temp1’) is not null
drop table temp1
if object_id(‘temp2’) is not null
drop table temp2
select prd_no,prd_name,ps_dd,ps_no,up,TAX_RTO into temp1 from (select prd_no,prd_name,ps_dd,ps_no,up,TAX_RTO,row_number() over (partition by prd_no order ]]></description><category></category></item><item><title><![CDATA[SQL SERVER中对temp1表中的所有数据逐条进行查询并将结果@aaa表中]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/117554933</link><guid>https://blog.youkuaiyun.com/luisls/article/details/117554933</guid><author>luisls</author><pubDate>Fri, 04 Jun 2021 11:42:27 +0800</pubDate><description><![CDATA[if object_id(‘temp1’) is not null
drop table temp1
if object_id(‘temp’) is not null
drop table temp
if object_id(‘ltmp’) is not null
drop table ltmp
if object_id(‘ltemp’) is not null
drop table ltemp
declare @aaa table
(
prd_no nvarchar(20),
bom_no nvarcha]]></description><category></category></item><item><title><![CDATA[SQL中的左连接先内查询]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/115956485</link><guid>https://blog.youkuaiyun.com/luisls/article/details/115956485</guid><author>luisls</author><pubDate>Wed, 21 Apr 2021 15:25:39 +0800</pubDate><description><![CDATA[形如：
select a.1,a.2,a.3,b.1,b.2,b.3 from (select * from xxx where xx1=‘tj’) a left join table2 b on a.1=b.1 and b.table22=‘tj2’
例如：
SELECT A.PRD_NO,A.CUS_NO,A.SUP_PRD_NO,b.nouse_dd FROM (SELECT * from prdt_cus1 a where a.cus_no=‘BBB’) A left join prdt b on ]]></description><category></category></item><item><title><![CDATA[把aaaaa表中的name字段更新到prdt的name字段中]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/115731780</link><guid>https://blog.youkuaiyun.com/luisls/article/details/115731780</guid><author>luisls</author><pubDate>Thu, 15 Apr 2021 17:11:25 +0800</pubDate><description><![CDATA[update prdt set name=aaaaa.name from aaaaa where prdt.prd_no=aaaaa.prd_no

]]></description><category></category></item><item><title><![CDATA[根据物料批量子件反查成品料号]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/115731691</link><guid>https://blog.youkuaiyun.com/luisls/article/details/115731691</guid><author>luisls</author><pubDate>Thu, 15 Apr 2021 17:09:43 +0800</pubDate><description><![CDATA[批量子件反查，查成品
create table #temp2
(
wlbh varchar(20),
cpbh varchar(20)
)
declare @ph varchar(20)
declare @count int
declare @i int
select @count=count() from dz$
set @i=1
while(@i&lt;=@count)
begin
;with
dcbom as
(select prd_no,bom_no from tf_bom where prd_no]]></description><category></category></item><item><title><![CDATA[SQL的CTE递归查询]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/109674165</link><guid>https://blog.youkuaiyun.com/luisls/article/details/109674165</guid><author>luisls</author><pubDate>Fri, 13 Nov 2020 14:35:51 +0800</pubDate><description><![CDATA[格式
以;with cte开头  （定义哪些列）as (查询的顶层  union all  内链接CTE查询 循环）
以下是 sunlike ERP系统的BOM表递归查询实列
;with cte(hb,partno,bb,level)
as
(
select bom_no,prd_no,id_no,0 as level from tf_bom where bom_no=‘301-74100-01-&gt;’
union all
select tf_bom.bom_no,prd_no,tf_bom.id_no]]></description><category></category></item><item><title><![CDATA[SQL判断临时表对象是否为空，不为空先清空]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/109111132</link><guid>https://blog.youkuaiyun.com/luisls/article/details/109111132</guid><author>luisls</author><pubDate>Fri, 16 Oct 2020 10:11:01 +0800</pubDate><description><![CDATA[if object_id(‘temp1’) is not null
drop table temp1

]]></description><category></category></item><item><title><![CDATA[在SQL SERVER 2008查询中赋变量值]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/108548254</link><guid>https://blog.youkuaiyun.com/luisls/article/details/108548254</guid><author>luisls</author><pubDate>Sat, 12 Sep 2020 13:10:40 +0800</pubDate><description><![CDATA[声明：DECLARE@变量名bai 类型
赋值：SET@变量名=值 或 SELECT@变量名=值
例：
declare @a NVARCHAR (100) = ‘’
set @a=‘301-18433-01’
select * from tf_bom where bom_no=@a+’-&gt;’

]]></description><category></category></item><item><title><![CDATA[SQL Server去除字段的空格]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/108119897</link><guid>https://blog.youkuaiyun.com/luisls/article/details/108119897</guid><author>luisls</author><pubDate>Thu, 20 Aug 2020 11:23:00 +0800</pubDate><description><![CDATA[Sql Server去除空格
–清除左边空格
ltrim(’   文字A’)    返回文字A
–清除右边空格
rtrim('文字B   ')  返回文字B
–左右同时清除
ltrim(rtrim(’   文字C   '))  返回文字C

]]></description><category></category></item><item><title><![CDATA[在sql中给一个table加上一列标记行数num]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/108049524</link><guid>https://blog.youkuaiyun.com/luisls/article/details/108049524</guid><author>luisls</author><pubDate>Mon, 17 Aug 2020 09:56:12 +0800</pubDate><description><![CDATA[select row_number() over(partition by prd_no order by PRD_NO)num,* from prdt1
按prd_no分类给序号标记，并排序，这种可以很快找到prd_no重复的并对其操作

]]></description><category></category></item><item><title><![CDATA[SQL中查询表中所有字段，并将字段用，串连成文本]]></title><link>https://blog.youkuaiyun.com/luisls/article/details/107960740</link><guid>https://blog.youkuaiyun.com/luisls/article/details/107960740</guid><author>luisls</author><pubDate>Wed, 12 Aug 2020 16:36:30 +0800</pubDate><description><![CDATA[“查询表的所有字段，并将所有字段用，串连成文本，用于查询字段很多的表”
1、查询所有字段（tit 是导入临时表，table是要查询的表名）
Select Name into tit FROM SysColumns Where id=Object_Id(‘table’)
2、将查询结果用，串连成文本
select stuff((select ‘,’+name from tit for xml path(’’)),1,1,’’)

...]]></description><category></category></item></channel></rss>