mysqlµÄ¸üÐÂÓï¾ä - Java / Java SE
id name datetime 1 a 2010-05-13 10:15:00 2 b 2010-05-14 09:10:00 3 d 2010-05-14 10:10:00 ÈçºÎ½«¾àÀëÄ¿Ç°×î½üµÄÄǸö¼Ç¼µÄname ¸üÐÂΪ¡°x¡±ÄØ Ð»Ð»¿© °¡ ºÇºÇ
update table_name set name='x' where datetime in (select max(datetime) as datetime from table_name)ÒýÓà update table_name set name='x' where datetime in (select max(datetime) as datetime from table_name) up£¡£¡£¡£¡ ¶Ô Ó¦¸Ã¾ÍÕâÑùµÄ ²»¹ýÈç¹ûÊý¾ÝÁ¿´óµÄ»°¿ÉÒÔÓÃexists update table_name a set name='x' where exists ( select 1 from ( select max(datetime) from table_name ) b where b.datetime=a.datetime ); update tble set name='x' where not exists (select 1 from tbl b where b.ttime<tble.ttime);ÒýÓà update table_name set name='x' where datetime in (select max(datetime) as datetime from table_name) ºÃÏñ²»ÐÐŶ ³öÏÖÕâÑùµÄ´íÎóŶ #1093 - You can't specify target table 'te_log' for update in from clause MYSQLÊý¾Ý¿â²»Ö§³Ö°É¡£ ´íÎóÌáʾ¾ÍÊÇ˵£¬²»ÄÜÏÈselect³öͬһ±íÖеÄijЩֵ£¬ÔÙupdateÕâ¸ö±í(ÔÚͬһÓï¾äÖÐ) ˼·£¬create table_name as select max(datetime) as datetime from table_name È»ºóupdate table_name set name='x' where datetime in ÉÏÃæÄǸö±í; È»ºódropÄǸö±íÊÔÊÔ ÊÔÁËһϲ»Ö§³Ö£¬×Ö²éѯÓÃÁÙ
Ïà¹ØÎÊ´ð£º
ÇëÎÒÓÃFCKÉÏ´«Îļþ,ÔÚ±¾µØµÄwindows»úÉϲâÊÔ¿ÉÒÔ£¬µ«²¿Êðµ½linux·þÎñÆ÷ÉϾÍÉÏ´«²»ÁËÎļþ£¬ÉÏ´«Îļþʱһֱ¿¨ÔÚÄÇÀï¡£Íû¸÷λ´óϺָµã£¬Ð»Ð»£¡ ·¹ý£¬°ïÄ㶥һÏ¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£ ÉÏ´«ÎļþµÄ·¾¶ÎÊÌ⣬ ......
ΪʲôHTMLÒÔ¼°Ò»Ð©ÆäËü±êÇ©»áÏÔʾһЩÌض¨±íÏÖÐÎʽÄØ£¿ÈçHTMLÖеĻ»ÐбêÇ©<BR/>ÔڵײãÊÇÔõÑùʵÏÖµÄÄØ£¿ÏÖʵµÄÔÀíÊÇʲôÄØ È¥W3C¹Ù·½ÍøÕ¾ÉÏ£¬¿´¿´°É£¡ÎÒÏëÒ»¿´Äã¾ÍÃ÷°×ÁË ÎҲºͱàÒëÔÀíÓйأ¬ä¯ÀÀÆ÷Àï¿É ......
ÎÒÊǸöÐÂÊÖ£¬Íû¸ßÊÖ½â´ð ÎÒÏÖÔÚÒѾ°²×°ÁËmysql£¬Ò²ÓÐmysqlµÄjdbc¡£µ«ÎÒÔõôÅäÖú󣬲ÅÄÜÔÚMyEclipseÀï²Ù×÷mysqlÄØ£¿Çë¸ßÊÖ˵Ïêϸµã ´ò¿ªMyeclipse----window---open perspective---MyEclipse database explorer-- ......
È磺 @superwaring("unchecked"); Õâ¸öÀïÃ涼¿ÉÒÔÈ¡ÄÄЩֵ°¡£¬»¹ÓÐÀàËÆµÄ @superwaring±êÇ©ÓÐÄÄЩ°¡ ûÓùý¡£¡£ ¿´jeeµÄapi javax.persistenceÀï @superwaring("unchecked");Ö»ÊǺöÂÔ ......
¾ÍÊǼòµ¥µÄ´«ÖµºÍÈ¡Öµ ÇëÎÊÂ¥Ö÷ÏëÎÊʲô£¿ jspÒ³Ãæ²ÉÓÃ±íµ¥»òÕßjavabean´«Öµ¶¼¿ÉÒÔ£¬Ê¹ÓÃrequest.getParameter()»ñµÃʹÓÃ±íµ¥´«¹ýÀ´µÄÖµ¡£ ÎÊÎÊÌ⣬ÏÈ°ÑÎÊÌâ˵Çå³þµã£¡£¡ ÎÊÌâÌ«Ä£ºý£¡£¡ ÎÊÎÊÌ⣬ÏÈ°ÑÎ ......