dkfr.net
当前位置:首页 >> SQL语句:查找某字段存在于一字符串,大神帮忙解答... >>

SQL语句:查找某字段存在于一字符串,大神帮忙解答...

试试这个语句: select * from archives where charindex('张三是李四的兄弟,也是何八的儿子',title) > 0 用的是charindex函数判断

这个只能告诉你个大致的方案,详细代码你自己完善吧 首先查询到你的表的ID select [id], [name] from [sysobjects] where [type] = 'u' and [name]='你需要的表名' order by [name] 然后查询你的表中所有的列,[name]是列名 select [name] into #...

先判断的位置 position('_'in column_name) 再截取字符串就可以了 substr(column_name,1,position('_' in column_name))

select tb2.*,tb1.级别,tb1.级别起始时间 from tb2 inner join(select select * from tb1 t1 where 级别起始时间=(select max(级别起始时间) from tb1 t2 where t1.姓名=t2.姓名))tb1on tb1.工号=tb2.工号

select orderID,Number,caiMing from A where Number=1

declare @aaa nvarchar(20) ; select @aaa = substring( 'RREN-PSS-NB-14-25' ,patindex('%-%','RREN-PSS-NB-14-25')+1 ,(len('RREN-PSS-NB-14-25')-patindex('%-%','RREN-PSS-NB-14-25')+1) ) select @aaa = substring( @aaa ,patindex('%-%',@...

select * from tablename where B in (select A from tablename)

declare varchar temp(10) select @temp=z from DB:A where ... if(@temp==1) select * from DB:B where... else if(@temp==2) select * from DB:C where... else if(@temp==3) select * from DB:D where... 这个思路应该是这样的,你自己把代...

1.select 员工编号,员工姓名,工资,case 部门号 when 10 then '财务部' when 20 then '研发部' when 30 then '销售部' else '未知部门' end from 部门表 2. select '*****'+'hello'+'*****' select replicate('*',5)+'hello'+replicate('*',5)...

表结构呢?

网站首页 | 网站地图
All rights reserved Powered by www.dkfr.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com