[前][次][番号順一覧][スレッド一覧]

mysql:6104

From: 遠藤 俊裕 <遠藤 俊裕 <endo_t@xxxxxxxxxx>>
Date: Wed, 11 Sep 2002 08:26:34 +0900
Subject: [mysql 06104] Re: 検索が正常に出来ない

遠藤です。

Wed, 11 Sep 2002 01:54:00 +0900 に、
"Tatsuya Kondo" <konet@xxxxxxxxxx> さんは書きました:

TK> 申し訳ありません。
TK> 確かに、testではなく、tinyintにしたハズなんですけど・・・。
TK> 
TK> 文字列だと判断されて上手く検索出来なかったみたいです。

ん?
それは違うと思うなぁ。。。^^;

mysql> drop table profile;
Query OK, 0 rows affected (0.15 sec)

mysql> create table profile ( name char(20), sex char(2), age text );
Query OK, 0 rows affected (0.09 sec)

mysql> desc profile;
+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| name  | varchar(20) | YES  |     | NULL    |       |
| sex   | char(2)     | YES  |     | NULL    |       |
| age   | text        | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+
3 rows in set (0.01 sec)

mysql> insert into profile values ('user1', 'ma', '10' );
Query OK, 1 row affected (0.10 sec)

mysql> insert into profile values ('user2', 'fm', '20' );
Query OK, 1 row affected (0.00 sec)

mysql> insert into profile values ('user3', 'fm', '25' );
Query OK, 1 row affected (0.01 sec)

mysql> insert into profile values ('user4', 'ma', '35' );
Query OK, 1 row affected (0.00 sec)

mysql> select * from profile where sex='ma' and age<=20 and age >=10;
+-------+------+------+
| name  | sex  | age  |
+-------+------+------+
| user1 | ma   | 10   |
+-------+------+------+
1 row in set (0.10 sec)

-- 
遠藤俊裕 <endo_t@xxxxxxxxxx>


[前][次][番号順一覧][スレッド一覧]

      6091 2002-09-10 14:37 ["Tatsuya Kondo" <kon] 検索が正常に出来ない                    
      6092 2002-09-10 15:04 ┣["altana" <altana@xxx]                                       
      6094 2002-09-10 15:13 ┣["KAWAI,Takanori" <GC]                                       
      6097 2002-09-10 16:58 ┃┗[fukuixyz <fukuixyz@x] 「 addslashes をつける」意味        
      6098 2002-09-10 18:34 ┃ ┣["KAWAI,Takanori" <GC]                                   
      6100 2002-09-10 19:20 ┃ ┗["Takashi Yamashita" ]                                   
      6106 2002-09-11 10:04 ┃  ┗[fukuixyz <fukuixyz@x]                                 
      6108 2002-09-11 11:29 ┃   ┣[mohri <mohri@xxxxxxx]                               
      6118 2002-09-11 14:30 ┃   ┗[<moeru@xxxxxxxxxx>  ]                               
      6120 2002-09-11 14:57 ┃    ┣[Tomohiro 'Tomo-p' KA]                             
      6122 2002-09-11 15:24 ┃    ┃┣["Takashi Yamashita" ]                           
      6151 2002-09-11 18:46 ┃    ┃┗[<moeru@xxxxxxxxxx>  ]                           
      6121 2002-09-11 15:24 ┃    ┗["KAWAI,Takanori" <GC]                             
      6095 2002-09-10 15:25 ┣[HAMAI Kyoichi <k-ham]                                       
      6096 2002-09-10 15:27 ┣[遠藤 俊裕 <endo_t@xx]                                       
      6099 2002-09-10 18:39 ┣["城" <sora_iro@xxxxx]                                       
      6101 2002-09-10 19:42 ┣["Takashi Yamashita" ]                                       
      6102 2002-09-10 20:24 ┣[楠吉彦 <moredebu@xxx]                                       
      6103 2002-09-11 01:54 ┃┗["Tatsuya Kondo" <kon]                                     
->    6104 2002-09-11 08:26 ┃ ┗[遠藤 俊裕 <endo_t@xx]                                   
      6105 2002-09-11 09:46 ┃  ┗["KAWAI,Takanori" <GC]                                 
      6107 2002-09-11 10:04 ┃   ┗[遠藤 俊裕 <endo_t@xx]                               
      6109 2002-09-11 11:57 ┃    ┗["城" <sora_iro@xxxxx]                             
      6111 2002-09-11 12:13 ┃     ┣[遠藤 俊裕 <endo_t@xx]                           
      6112 2002-09-11 12:25 ┃     ┗["Takashi Yamashita" ]                           
      6114 2002-09-11 13:32 ┃      ┗["城" <sora_iro@xxxxx]                         
      6115 2002-09-11 14:11 ┃       ┣["Tatsuya Kondo" <kon]                       
      6116 2002-09-11 14:08 ┃       ┗["Takashi Yamashita" ]                       
      6117 2002-09-11 14:29 ┃        ┗["城" <sora_iro@xxxxx]                     
      6119 2002-09-11 14:47 ┃         ┗[mohri <mohri@xxxxxxx]                   
      6123 2002-09-11 15:32 ┃          ┗["Takashi Yamashita" ]                 
      6128 2002-09-11 17:47 ┃           ┗[mohri <mohri@xxxxxxx]               
      6129 2002-09-11 17:58 ┃            ┗["城" <sora_iro@xxxxx]             
      6131 2002-09-11 18:20 ┃             ┗["Takashi Yamashita" ]           
      6110 2002-09-11 12:09 ┗["足田博信" <h_ashida]