¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 58°Ç
   
[MYSQL] varchar ¼ýÀÚÁ¤·Ä
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2011-09-26 (¿ù) 10:33 Á¶È¸ : 18938
±ÛÁÖ¼Ò :
                          

mysql> DESC TB_Table;
+--------+--------------+------+-----+---------+-------+
| Field  | Type         | Null | Key | Default | Extra |
+--------+--------------+------+-----+---------+-------+
| ymd    | varchar(15)  |      | PRI |         |       |
| ip     | varchar(255) |      | PRI |         |       |
| octets | varchar(255) |      |     | 0       |       |
| gbytes | varchar(255) |      |     | 0       |       |
| mbitps | varchar(255) |      |     | 0       |       |
+--------+--------------+------+-----+---------+-------+
5 rows in set (0.00 sec)
 
 
# ¹®ÀÚ¿­ Á¤·Ä¶§¹®¿¡ ÀÚ¸®¼ö±îÁö ¹Ý¿µ¾ÈµÊ
mysql> select * from TB_TRAFFIC_BACKUP where  ymd='20110923' order by gbytes DESC LIMIT 10;
+----------+-----------------+-------------+--------+--------+
| ymd      | ip              | octets      | gbytes | mbitps |
+----------+-----------------+-------------+--------+--------+
| 20110923 | XXX.XXX.6.21    | 8993603700  | 9      | 17     |
| 20110923 | XXX.XXX.140.105 | 9433388400  | 9      | 82     |
| 20110923 | XXX.XXX.15.133  | 8854516800  | 9      | 109    |
| 20110923 | XXX.XXX.161.239 | 7927218300  | 8      | 91     |
| 20110923 | XXX.XXX.46.187  | 8293270200  | 8      | 65     |
| 20110923 | XXX.XXX.14.89    | 7767715800  | 8      | 65     |
| 20110923 | XXX.XXX.161.48  | 6462369600  | 7      | 31     |
| 20110923 | XXX.XXX.15.94    | 64924760100 | 61     | 104    |
| 20110923 | XXX.XXX.157.144 | 5386317900  | 6      | 66     |
| 20110923 | XXX.XXX.7.221    | 5514294300  | 6      | 60     |
+----------+-----------------+-------------+--------+--------+
10 rows in set (1.04 sec)
 
# +0 À¸·Î ¼ýÀÚ¿¬»êÀ» ÇÏ°Ô µÇ¸é ¹®ÀÚ¿­À» °­Á¦·Î ¼ýÀÚ·Î ¹Ù²ã¼­ ó¸®
mysql> select * from TB_TRAFFIC_BACKUP where  ymd='20110923' order by gbytes+0 DESC LIMIT 10;
+----------+-----------------+-------------+--------+--------+
| ymd      | ip              | octets      | gbytes | mbitps |
+----------+-----------------+-------------+--------+--------+
| 20110923 | XXX.XXX.15.94    | 64924760100 | 61     | 104    |
| 20110923 | XXX.XXX.6.55    | 32159743800 | 30     | 25     |
| 20110923 | XXX.XXX.17.16    | 29648243400 | 28     | 69     |
| 20110923 | XXX.XXX.163.121 | 25003029900 | 24     | 84     |
| 20110923 | XXX.XXX.213.94   | 17743800000 | 17     | 41     |
| 20110923 | XXX.XXX.46.154  | 17481720300 | 17     | 100    |
| 20110923 | XXX.XXX.46.152  | 15550536300 | 15     | 162    |
| 20110923 | XXX.XXX.6.21    | 8993603700  | 9      | 17     |
| 20110923 | XXX.XXX.140.105 | 9433388400  | 9      | 82     |
| 20110923 | XXX.XXX.15.133  | 8854516800  | 9      | 109    |
+----------+-----------------+-------------+--------+--------+
10 rows in set (0.96 sec)
 

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.