Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQLͬһÌõ¼þ¶à×ֶβéѯ - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÓÐÒ»¸ö±í£¬ÈçÏ£º
create table #tmp(id int,cusno varchar(10),cusname nvarchar(50))

insert into #tmp(id,cusno,cusname)
select 1, 'C10001', 'ÁªÏëµçÄÔ' union all
select 2, 'C10002', '»ÝÆÕµçÄÔ' union all
select 3, 'C10003', '¹È¸è¹«Ë¾'

drop table #tmp

ÈçºÎʵÏÖ£¬¿É¸ù¾Ýcusno²éѯµÃµ½cusname½á¹û£¬»òÕ߸ù¾Ýcusname²éѯµÃµ½cusname½á¹û£º
select cusname from #tmp where cusno like '%C%'
select cusname from #tmp where cusname like '%µçÄÔ%'

create procedure sp_test
@str nvarchar(20)
as
--select cusname from #tmp where cusno like '%+@str+%'

´æ´¢¹ý³ÌÈçºÎʵÏÖ£¬¶àл£¡

SQL code:
select cusname from #tmp where cusno like '%C% or cusname like '%µçÄÔ%'


SQL code:
select cusname from #tmp where cusno like '%C%' or cusname like '%µçÄÔ%'


SQL code:

create procedure sp_test
@str nvarchar(20)
as

select cusname from #tmp where cusno like '%'+@str+'%' or cusname like '%'+@str+'%'


create procedure sp_test
@str nvarchar(20)
as
begin
  select cusname from #tmp where charindex(@str,cusno) > 0


Ïà¹ØÎÊ´ð£º

jspÁ´½Ósql2000µÄÒÉÎÊ£¿



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

sql ÎÊÌâ - MS-SQL Server / »ù´¡Àà

ÐèÇóÈçÏ£º
ѧԺ academy£¨aid,aname£©
°à¼¶ class£¨cid,cname,aid£©
ѧÉú stu(sid,sname,aid,cid)
סËÞÇø region(rid,rname)
ËÞÉáÂ¥ build(bid,rid,bnote) bnoteÊÇ¡®ÄС¯/¡®Å®¡¯
ËÞÉá dorm(did,rid,bid£¬bedn ......

Ôõô°ÑMDFÊý¾Ýתµ½MySQL£¿ - MS-SQL Server / »ù´¡Àà

Ôõô°ÑMDFÊý¾Ýתµ½MySQL£¿
ÖÁÉٵø½¼Óµ½sqlserverÉÏ

¾ßÌåÔõôŪ°¡ ÎҵıÏÒµÉè¼ÆµÄÊý¾Ý¿âÊÇ´ÓÍøÉÏdownÏÂÀ´µÄ£¿£¿

Ä㻹²»ÈçÖ±½ÓÓÃsqlserverÄØ

º¯Êý¡¢´æ´¢¹ý³Ì¶¼µÃ¸ÄÁË¡£

sqlserverûÔõôÓùý¡£Ò²Ã»Óа²× ......

sqlÓï¾äÎÊÌâ - Java / Web ¿ª·¢

select o_customer,o_price from orders having o_price >=avg(o_price)
select o_customer,o_price from orders where o_price >=(select avg(o_price) from orders)
ÎҸоõûÓÐÇø±ð°¡£¬ÔõôÔÚmysql»áÓÐ ......

SQLÄܽøÐжþ½øÖƵÄɸѡÂ𣿠- MS-SQL Server / »ù´¡Àà

ÎÒÓÐÒ»¸ö×Ö¶ÎÊÇ varchar(1) ÀàÐÍ£¬¶þ½øÖƱíʾҲ¾ÍÊÇ8λµÄ ¡®0000 0000¡¯
±ÈÈçÕâ¸öʱºòÎÒÐèҪɸѡ³öÕâ¸ö×Ö¶ÎΪËùÓÐµÄ ¡®0000 0100¡¯µÄÐУ¬ÇëÎÊSQLÄÜʵÏÖÕâÑùµÄ¡°Î»¡±µÄɸѡÂð£¿
лл~~~

ÓÐλ²Ù×ݺ¯ÊýÂ𣿲»ÐоÍ× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ