Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÄǸö±íÊÔÊÔ

ÊÔÁËһϲ»Ö§³Ö£¬×Ö²éѯÓÃÁÙ


Ïà¹ØÎÊ´ð£º

JSP/Servlet½»»¥ - Java / Web ¿ª·¢

JSPÒ³ÃæÖÐÓжà¸öradio°´Å¥
  JSPÒ³Ãæ½«²ÎÊýPOST¸øservlet
  
  ÒªÇóÈçÏÂ;
  1.Ñ¡ÔñÒ»¸öradio£¬µ÷ÓÃservlet servletÖиù¾Ý²ÎÊýµ÷ÓÃÆäËû½Ó¿Ú£¬³ý·ÇÑ¡ÖиÃradio²¢µã»÷JSPÖеÄʵР......

C/SÏîÄ¿¼Ü¹¹Éè¼Æ----ÇóÖú - Java / Java SE

±¾ÈËÕýÔÚÓÃJava×öÒ»¸öC/S¼Ü¹¹µÄÏîÄ¿£¬ 
¿ÉÊÇÓÉÓÚÏîÄ¿±È½Ï´ó£¬Ç°ÆÚ¶Ô¼Ü¹¹µÄÉè¼ÆÓÈÆäÖØÒª£¬ÒòΪºóÆÚ¿ÉÄÜËæÊ±»á¼Ó¸ö¹¦ÄÜ»òÕßÈ¥µôijЩ¹¦ÄÜ¡£ 
ËùÒÔÌØµØÑ°ÇóÈçºÎÉè¼ÆC/SµÄ¼Ü¹¹Ê¹³ÌÐò¸ü¼ÓÃæÏò¶ÔÏó¸ü¼ÓÒ×ÓÚά ......

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

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

jspÐÂÊÖ,Çë½Ì¸÷λ? - Java / Web ¿ª·¢

³ÌÐòÈçÏÂ:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" %>
<%@ page import="com.mysql.jdbc.Driver" %>
<%@ page import ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ