[Á°][¼¡][ÈÖ¹æ½ç°ìÍ÷][¥¹¥ì¥Ã¥É°ìÍ÷]

mysql:1920

From: ¤È¤ß¤¿¤Þ¤µ¤Ò¤í <¤È¤ß¤¿¤Þ¤µ¤Ò¤í <tommy@xxxxxxxxxx>>
Date: Thu, 20 Apr 2000 20:47:04 +0900
Subject: [mysql 01920] Re: select ʣʸ

¤È¤ß¤¿¤Ç¤¹¡£

At Thu, 20 Apr 2000 20:21:19 +1000,
Hirotaka Kondo ¶áÆ£¿Òδ <hiro@xxxxxxxxxx> wrote:

> delete from table where column <= (select max(column) from table) -10
> 
> ¤È¸À¤¦¤è¤¦¤Ê´¶¤¸¤Î¤ò¤ä¤Ã¤Æ¤ß¤¿¤Î¤Ç¤¹¤¬¡¢¤¦¤Þ¤¯¤¤¤­¤Þ¤»¤ó¡£(¼ÂºÝ¥Æ¥¹¥È¤Ï
> select¤Ç¤ä¤Ã¤Æ¤¤¤Þ¤¹)
> mySQL¤Ç¤Ï¡¢Ê¡¼¡Ì䤤¹ç¤ï¤»¤È¸À¤¦¤è¤¦¤Ê¤³¤È¤Ï½ÐÍè¤Ê¤¤¤Î¤Ç¤·¤ç¤¦¤«¡©
> 
> ½ÐÍè¤Ê¤±¤ì¤Ð¡¢¤³¤ì¤ÈƱ¤¸Æ°ºî¤¹¤ëʸ¤Ï¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤ç¤¦¤«¡£

ÉûÌ䤤¹ç¤ï¤»¤Ï MySQL ¤Ç¤Ï¤Þ¤À¤Ç¤­¤Ê¤¤¤Ç¤¹¡£

SQL °Ê³°¤Î¸À¸ì¤ò²ðºß¤µ¤»¤¿¤¯¤Ê¤¤¤Î¤Ê¤é¡¢3.23.x ¤Î¿·¤·¤¤¤Î¤·¤«¥À¥á¤Ç¤¹¤¬¡¢
¥æ¡¼¥¶ÊÑ¿ô¤ò»È¤Ã¤Æ¡¢¼¡¤Î¤è¤¦¤Ê´¶¤¸¤Ç¤É¤¦¤Ç¤·¤ç¤¦¡© Ì¿Îá¤ò2²óȯ¹Ô¤·¤Æ¤·¤Þ
¤¤¤Þ¤¹¤¬¡Ä¡£

	select @c:=max(column) from table;
	delete from table where column <= @c - 10;

# »î¤·¤Æ¤Þ¤»¤ó¡£

--
¤È¤ß¤¿¤Þ¤µ¤Ò¤í <tommy@xxxxxxxxxx>

[Á°][¼¡][ÈÖ¹æ½ç°ìÍ÷][¥¹¥ì¥Ã¥É°ìÍ÷]

      1918 2000-04-20 19:21 [Hirotaka Kondo ¶áÆ£¿] select ʣʸ                             
->    1920 2000-04-20 20:47 ¨±[¤È¤ß¤¿¤Þ¤µ¤Ò¤í <tomm]                                       
      1921 2000-04-20 20:50 ¡¡¨²["Y. Tsutsui" <tutui@]                                     
      1925 2000-04-21 21:13 ¡¡¨­¨±[¤È¤ß¤¿¤Þ¤µ¤Ò¤í <tomm]                                   
      1923 2000-04-21 10:43 ¡¡¨±[Hirotaka Kondo ¶áÆ£¿]