mysql:6242
From: Daiju Azuma <Daiju Azuma <daiju_azuma@xxxxxxxxxx>>
Date: Thu, 19 Sep 2002 15:16:34 +0900
Subject: [mysql 06242] Re: OR と AND を複数使った検索で・・・
On Thu, 19 Sep 2002 15:01:20 +0900 平松 幸治 <kouji@xxxxxxxxxx> wrote: > SELECT * FROM $MySQLTable WHERE id = 3 OR id = 4 OR id = 8 AND name = 'AAA' AND no = 'BBB'" ); 最後の「)」はいらないと思いますが。 SELECT * FROM $MySQLTable WHERE name = 'AAA' AND no = 'BBB' and (id = 3 OR id = 4 OR id = 8); で,いかがでしょう。 http://www.mysql.gr.jp/jpdoc/4.0/manual.ja_MySQL_Optimization.html#Where_optimizations -- 神戸市教育委員会庶務課 情報企画係 東 大樹 tel:078-322-5761 fax:078-322-6145 Daiju Azuma <daiju_azuma@xxxxxxxxxx> >どこに行かれます?モニターの電源を消しましたか? ノートパソコンの蓋を閉じましたか?
6207 2002-09-18 19:27 [Tybalt of Capulet <i] スレッド式掲示板のテーブル構造について 6208 2002-09-18 19:36 ┣[荒井 哲三 <tetsumi.] 6209 2002-09-18 19:45 ┣[Yuya.Nishida. <yuya@] 6210 2002-09-18 20:23 ┃┗[Tybalt of Capulet <i] 6211 2002-09-18 20:33 ┃ ┣[Tomohiro 'Tomo-p' KA] 6213 2002-09-18 20:41 ┃ ┣["Kaigai Kohei" <kaig] 6214 2002-09-18 20:49 ┃ ┣[Yuya.Nishida. <yuya@] 6216 2002-09-18 20:54 ┃ ┗[Takanori Tobe <taka@] 6212 2002-09-18 20:37 ┣[NAGASAWA Teruo <ml@x] 6217 2002-09-18 21:16 ┣[HAMAI Kyoichi <k-ham] 6225 2002-09-19 03:20 ┃┗["umemura" <shigemi.u] 6218 2002-09-18 21:17 ┣["KAWAI,Takanori" <GC] 6219 2002-09-18 21:33 ┃┗[Tomohiro 'Tomo-p' KA] 6220 2002-09-18 22:02 ┃ ┗["KAWAI,Takanori" <GC] 6222 2002-09-18 22:14 ┃ ┣["黒木 玲" <kuroki434] 6223 2002-09-19 01:02 ┃ ┃┗[Tybalt of Capulet <i] 6224 2002-09-19 03:16 ┃ ┃ ┣[<rio-t@xxxxxxxxxx> ] 6227 2002-09-19 07:15 ┃ ┃ ┃┣["kosugi" <kosugi@xxx] 6228 2002-09-19 09:32 ┃ ┃ ┃┃┗["Takashi Yamashita" ] 6229 2002-09-19 10:06 ┃ ┃ ┃┗[Tybalt of Capulet <i] 6230 2002-09-19 10:21 ┃ ┃ ┃ ┗["黒木 玲" <kuroki434] 6232 2002-09-19 11:01 ┃ ┃ ┃ ┗[Toyoshima Hiroshi <t] 6233 2002-09-19 11:33 ┃ ┃ ┃ ┗[Tomohiro 'Tomo-p' KA] 6236 2002-09-19 12:26 ┃ ┃ ┃ ┗[Toyoshima Hiroshi <t] 6237 2002-09-19 12:52 ┃ ┃ ┃ ┗[HAMAI Kyoichi <k-ham] 6231 2002-09-19 10:46 ┃ ┃ ┗["KAWAI,Takanori" <GC] 6234 2002-09-19 12:18 ┃ ┗[<n.futami@xxxxxxxxxx] 6238 2002-09-19 13:52 ┃ ┣["kosugi" <kosugi@xxx] 6247 2002-09-20 11:50 ┃ ┗[Tybalt of Capulet <i] 6248 2002-09-20 12:53 ┃ ┣[Yuya.Nishida. <yuya@] 6249 2002-09-20 13:21 ┃ ┃┗["KAWAI,Takanori" <GC] 6252 2002-09-20 13:59 ┃ ┃ ┗[Yuya.Nishida. <yuya@] 6251 2002-09-20 13:51 ┃ ┣["KAWAI,Takanori" <GC] 6255 2002-09-20 22:53 ┃ ┗["kosugi" <kosugi@xxx] 6257 2002-09-21 02:31 ┃ ┗[Tybalt of Capulet <i] 6258 2002-09-21 05:18 ┃ ┗["kosugi" <kosugi@xxx] 6259 2002-09-21 08:18 ┃ ┣["黒木 玲" <kuroki434] 6260 2002-09-21 09:40 ┃ ┗["KAWAI,Takanori" <GC] 6261 2002-09-21 11:16 ┃ ┗["kosugi" <kosugi@xxx] 6262 2002-09-21 11:46 ┃ ┗["kosugi" <kosugi@xxx] 6221 2002-09-18 22:10 ┣["kosugi" <kosugi@xxx] 6226 2002-09-19 06:39 ┃┗["kosugi" <kosugi@xxx] 6235 2002-09-19 12:25 ┣[You2 <ml-mysql@xxxxx] 6239 2002-09-19 15:01 ┗[平松 幸治 <kouji@xx] OR と AND を複数使った検索で・・・ 6240 2002-09-19 15:09 ┣[平松 幸治 <kouji@xx] 6243 2002-09-19 15:35 ┃┗[平松 幸治 <kouji@xx] 6244 2002-09-19 16:34 ┃ ┗["Takashi Yamashita" ] 6250 2002-09-20 13:40 ┃ ┗[平松 幸治 <kouji@xx] 6241 2002-09-19 15:16 ┣[SAKIMURA Noriyuki <s] -> 6242 2002-09-19 15:16 ┗[Daiju Azuma <daiju_a]