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

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ÉÏ´«Îļþµ½linux·þÎñÆ÷ÎÊÌâ - Java / Java EE

ÇëÎÒÓÃFCKÉÏ´«Îļþ,ÔÚ±¾µØµÄwindows»úÉϲâÊÔ¿ÉÒÔ£¬µ«²¿Êðµ½linux·þÎñÆ÷ÉϾÍÉÏ´«²»ÁËÎļþ£¬ÉÏ´«Îļþʱһֱ¿¨ÔÚÄÇÀï¡£Íû¸÷λ´óϺָµã£¬Ð»Ð»£¡
·¹ý£¬°ïÄ㶥һÏ¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£

ÉÏ´«ÎļþµÄ·¾¶ÎÊÌ⣬ ......

HTML±êÇ©µ×²ãµÄʵÏÖÔ­Àí¡¢»úÖÆ - Java / Java SE

ΪʲôHTMLÒÔ¼°Ò»Ð©ÆäËü±êÇ©»áÏÔʾһЩÌض¨±íÏÖÐÎʽÄØ£¿ÈçHTMLÖеĻ»ÐбêÇ©<BR/>ÔڵײãÊÇÔõÑùʵÏÖµÄÄØ£¿ÏÖʵµÄÔ­ÀíÊÇʲôÄØ
È¥W3C¹Ù·½ÍøÕ¾ÉÏ£¬¿´¿´°É£¡ÎÒÏëÒ»¿´Äã¾ÍÃ÷°×ÁË

ÎҲºͱàÒëÔ­ÀíÓйأ¬ä¯ÀÀÆ÷Àï¿É ......

myeclipse+mysqlµÄÅäÖÃÎÊÌâ - Java / Eclipse

ÎÒÊǸöÐÂÊÖ£¬Íû¸ßÊÖ½â´ð
ÎÒÏÖÔÚÒѾ­°²×°ÁËmysql£¬Ò²ÓÐmysqlµÄjdbc¡£µ«ÎÒÔõôÅäÖú󣬲ÅÄÜÔÚMyEclipseÀï²Ù×÷mysqlÄØ£¿Çë¸ßÊÖ˵Ïêϸµã
´ò¿ªMyeclipse----window---open perspective---MyEclipse database explorer-- ......

javaÖеÄ×¢½â¿ÉÒÔÓÐÄÄЩ£¿ - Java / Java EE

È磺 @superwaring("unchecked");
Õâ¸öÀïÃ涼¿ÉÒÔÈ¡ÄÄЩֵ°¡£¬»¹ÓÐÀàËÆµÄ @superwaring±êÇ©ÓÐÄÄЩ°¡
ûÓùý¡£¡£

¿´jeeµÄapi
javax.persistenceÀï
@superwaring("unchecked");Ö»ÊǺöÂÔ ......

javaÖд«Öµ - Java / Web ¿ª·¢

¾ÍÊǼòµ¥µÄ´«ÖµºÍÈ¡Öµ
ÇëÎÊÂ¥Ö÷ÏëÎÊʲô£¿

jspÒ³Ãæ²ÉÓÃ±íµ¥»òÕßjavabean´«Öµ¶¼¿ÉÒÔ£¬Ê¹ÓÃrequest.getParameter()»ñµÃʹÓÃ±íµ¥´«¹ýÀ´µÄÖµ¡£

ÎÊÎÊÌ⣬ÏÈ°ÑÎÊÌâ˵Çå³þµã£¡£¡ ÎÊÌâÌ«Ä£ºý£¡£¡

ÎÊÎÊÌ⣬ÏÈ°ÑÎ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ