兴国资源网 Design By www.nnzcdc.com
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[f_Sql]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[f_Sql]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[序数表]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [序数表]
GO

--为了效率,所以要一个辅助表配合
select top 1000 id=identity(int,1,1) into 序数表 
from syscolumns a,syscolumns b
alter table 序数表 add constraint pk_id_序数表 primary key(id)
go

/*--根据指定字符串生成查询的模糊匹配字符串

 条件连接的关键字为 and,or
 可以任意指定括号
 生成的条件表达式为 like 模糊匹配

--邹建 2004.08(引用请保留此信息)--*/

/*--调用示例

 --调用示例
 select A=dbo.f_Sql('(Web or HTML or Internet) and (Programmer or Developer)','content')
 select B=dbo.f_Sql('Web or HTML or Internet','content')
 select C=dbo.f_Sql('(Web and HTML)','content')
 select D=dbo.f_Sql('Web','content')
--*/
--示例函数
create function f_Sql(
@str Nvarchar(1000), --要检索的字符串
@fdname sysname --在那个字段中检索
)returns Nvarchar(4000)
as
begin
 declare @r Nvarchar(4000)
 set @r=''
 select @r=@r+case
  when substring(@str,id,charindex(' ',@str+' ',id)-id) in('or','and')
   then ' '+substring(@str,id,charindex(' ',@str+' ',id)-id)+' '
  when substring(@str,id,1)='('
   then '(['+@fdname+'] like ''%'
    +substring(@str,id+1,charindex(' ',@str+' ',id)-id-1)
    +'%'''
  when substring(@str,charindex(' ',@str+' ',id)-1,1)=')'
   then '['+@fdname+'] like ''%'
    +substring(@str,id,charindex(' ',@str+' ',id)-id-1)
    +'%'')'
  else '['+@fdname+'] like ''%'
   +substring(@str,id,charindex(' ',@str+' ',id)-id)
   +'%'''
  end
 from 序数表
 where id<=len(@str)
  and charindex(' ',' '+@str,id)-id=0
 return(@r)
end
go

兴国资源网 Design By www.nnzcdc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
兴国资源网 Design By www.nnzcdc.com

P70系列延期,华为新旗舰将在下月发布

3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。

而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?

根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。