°ÑSqlÊý¾Ýת»»ÎªÒµÎñÊý¾ÝµÄ¼¸ÖÖ·½·¨
ORMϵͳ±ØÐë°ÑÊý¾Ý¿âÖеÄÊý¾Ýת»»ÎªÒµÎñÊý¾Ý£¬×ª»»µÄ·½·¨´óÖÂÓÐ3ÖÖ£¬±¾ÎľÍÊÔͼ¶ÔËüÃÇ×öһЩ¼òµ¥·ÖÎö¡£
1¡¢ÊôÐÔ·´Éä¡£¾ÍÊÇͨ¹ý·´É䣬»ñȡҵÎñʵÌåÀàµÄ¸÷¸öÊôÐÔ£¬È»ºóÔÙÉèÖÃÕâЩÊôÐÔµÄÖµ¡£Õâ¸ö·½·¨×î¼òµ¥¡¢×îÎȶ¨¡¢Í¨ÓÃÐÔ×îÇ¿¡¢¿Éά»¤ÐÔ×îÇ¿¡¢ÐÔÄÜ×î²î¡£ÀýÈçNHibernate¾ÍÊÇÓÃÕâÖÖ·½·¨ÊµÏֵģ¬Ëüͨ¹ýIGetterºÍISetter½Ó¿ÚʵÏÖ¶Ôij¸öÒµÎñʵÌåÀàÊôÐԵĶÁÈ¡ºÍдÈë¡£DongLiORMµÄÔçÆÚ°æ±¾Ò²ÊÇÓõÄÕâÖÖ·½·¨£¬Ëûͨ¹ýBusinessObjectµÄÊôÐÔË÷ÒýÆ÷ʵÏÖ¡£ÆäÔÀí¾ÍÊÇÊ×ÏÈͨ¹ý»ñȡij¸öÒµÎñʵÌåÀàij¸öÊôÐÔµÄPropertyInfo£¬È»ºóµ÷ÓøÃPropertyInfoµÄGetValue»òÕßSetValue·½·¨¡£ÀàËÆµÄ´úÂëÈçÏ£º
PropertyInfo info = BusinessType.GetProperty(PropertyName);
info.SetValue(this, value, null);
±ÈÈ磬ÏÖÔÚÓÐÒ»¸öÒµÎñʵÌåÀàUserItem£¬Æä¶¨ÒåÈçÏ£º
public class UserItem
{
public UserItem() { }
private string _userid;
private string _username;
private string _pwd;
private string _email;
public string UserID
{
set { _userid = value; }
get { return _userid; }
}
public string UserName
{
set { _username = value; }
get { return _username; }
}
public string Pwd
{
set { _pwd = value; }
 
Ïà¹ØÎĵµ£º
CASE ¿ÉÄÜÊÇ SQL Öб»ÎóÓÃ×î¶àµÄ¹Ø¼ü×ÖÖ®Ò»¡£ËäÈ»Äã¿ÉÄÜÒÔǰÓùýÕâ¸ö¹Ø¼ü×ÖÀ´´´½¨×ֶΣ¬µ«ÊÇËü»¹¾ßÓиü¶àÓ÷¨¡£ÀýÈ磬Äã¿ÉÒÔÔÚ WHERE
×Ó¾äÖÐʹÓà CASE¡£
Ê×ÏÈÈÃÎÒÃÇ¿´Ò»Ï CASE µÄÓï·¨¡£ÔÚÒ»°ãµÄ SELECT ÖУ¬ÆäÓï·¨ÈçÏ£º
SELECT =
CASE
WHEN THEN
WHEN THEN
ELSE
......
Ò»¡¢×Ö·ûת»»º¯Êý
1¡¢ASCII()
·µ»Ø×Ö·û±í´ïʽ×î×ó¶Ë×Ö·ûµÄASCII ÂëÖµ¡£ÔÚASCII£¨£©º¯ÊýÖУ¬´¿Êý×ÖµÄ×Ö·û´®¿É²»ÓÑ’À¨ÆðÀ´£¬µ«º¬ÆäËü×Ö·ûµÄ×Ö·û´®±ØÐëÓÑ’À¨ÆðÀ´Ê¹Ó㬷ñÔò»á³ö´í¡£
2¡¢CHAR()
½«ASCII Âëת»»Îª×Ö·û¡£Èç¹ûûÓÐÊäÈë0 ~ 255 Ö®¼äµÄASCII ÂëÖµ£¬CHAR£¨£© ·µ»ØNULL ¡£
3¡¢LOWE ......
ÈçºÎÉú³Éexplain plan?
¡¡¡¡½â´ð:ÔËÐÐutlxplan.sql. ½¨Á¢plan ±í
¡¡¡¡Õë¶ÔÌØ¶¨SQLÓï¾ä£¬Ê¹Óà explain plan set statement_id = 'tst1' into plan_table
¡¡¡¡ÔËÐÐutlxplp.sql »ò utlxpls.sql²ì¿´explain plan
EXPLAIN PLAN ÊÇÒ»¸öºÜºÃµÄ·ÖÎöSQLÓï¾äµÄ¹¤¾ß,ËüÉõÖÁ¿ÉÒÔÔÚ²»Ö´ÐÐSQLµÄÇé¿öÏ·ÖÎöÓï¾ä. ͨ¹ý·ÖÎö,ÎÒÃǾͿÉÒÔÖ ......
ͨ¹ý·ÖÎöSQLÓï¾äµÄÖ´Ðмƻ®ÓÅ»¯SQL(×ܽá)
×ö DBA¿ì7ÄêÁË£¬Öмä¸ÐÎòºÜ¶à¡£ÔÚDBAµÄÈÕ³£¹¤×÷ÖУ¬µ÷Õû¸ö±ðÐÔÄܽϲîµÄSQLÓï¾äʱһÏÓÐÌôÕ½ÐԵŤ×÷¡£ÆäÖеĹؼüÔÚÓÚÈçºÎµÃµ½SQLÓï¾äµÄÖ´Ðмƻ®ºÍÈçºÎ´ÓSQLÓï¾äµÄÖ´Ðмƻ®Öз¢ÏÖÎÊÌâ¡£×ÜÊÇÏ뽫ÈÕ³£¾ÑéµÄµãµãµÎµÎ×ܽáһϣ¬µ«ÊÇÖ±µ½×î½ü²Å϶¨¾öÐÄ£¬×ܹ²»¨ÁË3¸öÖÜĩʱ¼ä£¬²Å½«Æä ......
ʹÓùýSQL Server 2000µÄÈ˶¼ÖªµÀ£¬ÒªÏëʵÏÖÐÐÁÐת»»,±ØÐë×ÛºÏÀûÓþۺϺ¯ÊýºÍ¶¯Ì¬SQL£¬¾ßÌåʵÏÖÆðÀ´ÐèÒªÒ»¶¨µÄ¼¼ÇÉ£¬¶øÔÚSQL Server 2005ÖУ¬Ê¹ÓÃÐÂÒý½øµÄ¹Ø¼ü×ÖPIVOT/UNPIVOT£¬Ôò¿ÉÒÔºÜÈÝÒ×µÄʵÏÖÐÐÁÐת»»µÄÐèÇó¡£
ÔÚ±¾ÎÄÖÐÎÒÃǽ«Í¨¹ýÁ½¸ö¼òµ¥µÄÀý×ÓÏêϸ½²½âPIVOT/UNPIVOTµÄÓ÷¨¡£
PIVOTµÄÓ÷¨£º
Ê×ÏÈ´´½¨²âÊÔ±í£¬È» ......