ÎÒÐèҪʹÓÃnhibernateµ÷ÓÃmysqlº¯Êý£¬ÀàËÆµÄsqlÓï¾ä£º
select * from concat(',', ServiceCodes, ',') like '%,33,%';
»òselect * from (','||ServiceCodes||',') like '%,33,%';
ËùÒÔÎÒ¾ÍÕâÑùµ÷Óãº
//.....
C# code:
or.Add(Restrictions.Like(Projections.SqlFunction("concat", NHibernateUtil.String, Projections.Property("ServiceCodes")), "%," + item + ",%"));
//....
Projections.SqlFunctionº¯ÊýµÚÈý¸ö²ÎÊýÊÇparams IProjection[] projections£¬µ«ÊǶÔÓÚ¶ººÅ(,)ÎÒ²»ÖªµÀÔõô´´½¨IProjectionÀàËÆ¡£
Çë¸÷λָ½Ì¡£¡£¡£
select * from concat(',', ServiceCodes, ',') like '%,33,%';
»òselect * from (','||ServiceCodes||',') like '%,33,%';
->
select * from table where concat(',', ServiceCodes, ',') like '%,33,%';
»òselect * from table where (','||ServiceCodes||',') like '%,33,%';
µÈ´ý´ð°¸¡£
ÁíÒ»µØÖ·£ºhttp://stackoverflow.com/questions/2680116/invoke-sql-function-using-nhibernate
¿ÉÁ¯£¬Ã»ÈËÀí.........
ÃìãµÄ¶¥Ò»ÏÂ...
ûÓнá¹û£¬²»ÂúÒâ½áÕË
21cnµÄÓÊÏ䣬ÔÚoutlookÅäÖúó¿ÉÒÔÕý³£ÊÕ·¢Óʼþ£¬¿ÉÊÇÎÒдÔÚC#ÖоͲ»ÐУ¬»»³ÉÆäËüÓÊÏ䣬163ºÜÔç×¢²áµÄ¡£¿ÉÒÔ·¢ËÍ¡£²éÁ˺ܾã¬Ã»ÓÐÕÒµ½ÔÒò£¬Çë¸ßÊÖ°ïæ½â´ð¡£¡£¡£Ð¡µÜ£¬Ð»ÁË¡£¡£´úÂëÈçÏ£º
private void SendMail ......
1¡¢ÊDz»ÊÇPHPÖÐÖ»ÄÜʹÓÃmysql_query("update user_aa set money=money2-".$bpanmm." where uid=".$userppp);¸üÐÂÊý¾Ý£¿£¿£¿
2¡¢PHP¸üÐÂmysql_fetch_row($res)Óëmysql_fetch_array($res)ÖеÄÊý¾ ......
ÎÒ´Óºǫ́»ñÈ¡ÁËϱßÒ»¶Îhtml´úÂ뵫ÎÒÏÖÔÚÏë°É<span></span>ÀïµÄÄÚÈݹýÂËÈ¥µôËÄܸø¸öºÃµÄ£¬¼òµ¥µÄ·½·¨
¶àл¸÷λÁË¡¡
<html>
<body>
<div>
<sp ......