±í talbe
A B
1 1,2,3
2 1
3 1,2
4 1,11,12,25
5 2,3
6 15,18
","Ϊ·Ö¸ô·ûºÅ,»¹ÓÐΪ"|"
ÏëÓÃÒ»ÌõÊý¾Ý²éѯ³ö B×Ö¶Î Öк¬ÓÐ"1"µÄÊý¾Ý(·Ö¸ô·ûºÅ·Ö¿ª²Å¿ÉÒÔ)
SQL code:
where charindex(',1,',','+replace(B,'|',',')+',')>0
SQL code:
select * from table
where charindex(',1,',','+replace(B,'|',',')+',') > 0
SQL code:
CREATE TABLE [dbo].[#Shop] ([A] [varchar] (4) ,[B] [varchar] (10))
INSERT INTO #Shop
select 1,'1,2,3' union all
select 2,'1' union all
select 3,'1,2' union all
select 4,'1,11,12,25' union all
select 5, '2,3' union all
select 6,'15'
select * from #Shop where charindex(',1,',','+replace(B,'|',',')+',')>0
µÚ¶þÌõ¼Ç¼¾Í²é²»³öÀ´ÁË
SQL code
Co
select convert(varchar(50),cast(convert(numeric(18,2),1275674000000/100000000)as real))+'ÒÚ'
select cast(convert(numeric(18,2),1275674000000/100000000)as real)
ΪʲôÉÏÒ»¸öÓÃvarcharת»»ºó¾ÍÖ»±£ÁôÁËÒ ......