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

µ÷ÓÃSQLº¯ÊýÀ´ÊµÏÖºº×ÖÄ£ºý²éѯ

ÔÚsqlÖд´½¨Óû§×Ô¶¨Ò寴Òôº¯Êý£º
create function f_GetPy(@Str nvarchar(400))
returns nvarchar(4000)
as
begin
declare @strlen int,@re nvarchar(4000)
declare @t table(chr nchar(1) collate Chinese_PRC_CI_AS,letter nchar(1))
insert @t select 'ß¹','A' union all select '°Ë','B'
union all select 'àê','C' union all select '咑','D'
union all select '妸','E' union all select '·¢','F'
union all select 'ê¸','G' union all select 'îþ','H'
union all select 'Ø¢','J' union all select 'ßÇ','K'
union all select 'À¬','L' union all select '嘸','M'
union all select '拏','N' union all select 'àÞ','O'
union all select '妑','P' union all select 'Æß','Q'
union all select '呥','R' union all select 'Øí','S'
union all select 'Ëû','T' union all select '屲','W'
union all select 'Ϧ','X' union all select 'Ѿ','Y'
union all select '帀','Z'
select @strlen=len(@str),@re=''
while @strlen>0
begin
select top 1 @re=letter+@re,@strlen=@strlen-1
from @t a where chr<=substring(@str,@strlen,1)
order by chr desc
if @@rowcount=0
select @re=substring(@str,@strlen,1)+@re,@strlen=@strlen-1
end
return(@re)
end
go
--²âÊÔ
select dbo.f_GetPy('¶«Ý¸ÊÐ') as ¶«Ý¸ÊÐ,dbo.f_GetPy('abÖÐc¹úÈË') as ÖйúÈË
--ÒÔºó²éѯµÄʱºò,¾Í¿ÉÒÔµ÷ÓÃÉÏÃæµÄº¯ÊýÀ´ÊµÏÖºº×ÖÄ£ºý²éѯ
select * from ±í where dbo.f_getpy(×Ö¶Î)='zgyh'


Ïà¹ØÎĵµ£º

SQL Server Ë÷Òý½á¹¹¼°ÆäʹÓã¨ËÄ£©

¾Û¼¯Ë÷ÒýµÄÖØÒªÐÔºÍÈçºÎÑ¡Ôñ¾Û¼¯Ë÷Òý
¡¡¡¡ÔÚÉÏÒ»½ÚµÄ±êÌâÖУ¬±ÊÕßдµÄÊÇ£ºÊµÏÖСÊý¾ÝÁ¿ºÍº£Á¿Êý¾ÝµÄͨÓ÷ÖÒ³ÏÔʾ´æ´¢¹ý³Ì¡£ÕâÊÇÒòΪÔÚ½«±¾´æ´¢¹ý³ÌÓ¦ÓÃÓÚ“°ì¹«×Ô¶¯»¯”ϵͳµÄʵ¼ùÖÐʱ£¬±ÊÕß·¢ÏÖÕâµÚÈýÖÖ´æ´¢¹ý³ÌÔÚСÊý¾ÝÁ¿µÄÇé¿öÏ£¬ÓÐÈçÏÂÏÖÏó£º
1¡¢·ÖÒ³ËÙ¶ÈÒ»°ãά³ÖÔÚ1ÃëºÍ3ÃëÖ®¼ä¡£
2¡¢ÔÚ²éѯ×îºóһҳʱ£¬ ......

±¨±ísqlÐĵÃһƪ

×î½üºÜ棬ÓиöÏîÄ¿ÂíÉÏÒªÕб꣬һ¸öÏîÄ¿µÈ׏¤£¬Èô¸ÉËöËéµÄʽøÐÐÖУ¬ÓÐÒ»¶Îʱ¼äû¸üÐÂЩÓÐÓªÑøµÄ¶«Î÷ÁË
˵¸öÌâÍâ»°ÏÈ¡£
½ñÌ쿪»ú×¼±¸°Ñ×òÌìµÄ¶«Î÷debugһϣ¬ºÜϰ¹ßµØÓÒ¼üÏîÄ¿µÄÆô¶¯Îļþ¿ªÊ¼debug£¬»úÆ÷ͻȻÀ¶ÆÁÖØÆô¡£¿ªÊ¼ÒÔΪÓÖÊÇÄÚ´æÔÚ͵͵³¬Æµ£¬¼ì²éÁËÒ»ÏÂbios£¬·¢ÏÖûʲôÎÊÌ⣬ҲûÔõôÔÚÒ⣬ËíÖØÐ¿ªÆôvs2008¼ÌÐø ......

¹ØÓÚSQLÖÐÓÃJoin in ²éѯµÄÓ÷¨


ÍâÁª½Ó:ÍâÁª½Ó¿ÉÒÔÊÇ×óÏòÍâÁª½Ó¡¢ÓÒÏòÍâÁª½Ó»òÍêÕûÍⲿÁª½Ó¡£
ÔÚ   from   ×Ó¾äÖÐÖ¸¶¨ÍâÁª½Óʱ£¬¿ÉÒÔÓÉÏÂÁм¸×鹨¼ü×ÖÖеÄÒ»×éÖ¸¶¨£º   
 LEFT   JOIN   »ò   LEFT   OUTER   JOIN;    
×óÏòÍâÁª½ÓµÄ½á¹û¼¯°üÀ ......

hibernate ´òÓ¡SQLÓï¾äµ½¿ØÖÆÌ¨

Ö»ÐèÒªÔÚÅäÖÃÎļþÀï         hibernate.show_sql=true
    <property name="hibernateProperties">
      <value>
        hibernate.dialect=org.hibernate.dialect.Oracle9Dialect ......

bulletedlist ¼Ó sql server ²É¼¯ÍøÕ¾µØÖ·

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ