Mysql Union 複数テーブルから結果を取得
where句も2つの結果の並べ替えもOKのようです。
mysql> (select title from bid where match(title,description) against(“*W1:3,2:1 DVD” in boolean mode) limit 2) UNION ( select title from bid_0910 where match(title,description) against(“*W1:3,2:1 high” in boolean mode) limit 2) order by title\G;
*************************** 1. row ***************************
title: amazonの中古最低価格より安い!新品「TOEFL GrammarWorkbook」T
*************************** 2. row ***************************
title: 人気の一体型 DESKPOWER LX50M●CelD 2.9G 512M 300G Sマルチ
*************************** 3. row ***************************
title: $動作品☆Lavie ☆LT/Pm1,6G/512MB/100GB/DVD-S$Wlan/TV
*************************** 4. row ***************************
title: 業界一の安心対応! high power HT4B-5 1年保証 密閉式
4 rows in set (0.01 sec)
mysql> (select title from bid where match(title,description) against(“*W1:3,2:1 DVD” in boolean mode) limit 2) UNION ( select title from bid_0910 where match(title,description) against(“*W1:3,2:1 high” in boolean mode) limit 2) order by title desc\G;
*************************** 1. row ***************************
title: 業界一の安心対応! high power HT4B-5 1年保証 密閉式
*************************** 2. row ***************************
title: $動作品☆ Lavie ☆LT/Pm1,6G/512MB/100GB/DVD-S Wlan/TV
*************************** 3. row ***************************
title: 人気の一体型 DESKPOWER LX50M●CelD 2.9G 512M 300G Sマルチ
*************************** 4. row ***************************
title: amazon の中古最低価格より安い!新品「 TOEFL GrammarWorkbook」T
4 rows in set (0.01 sec)
うまくいきました。
- Prev mysql : copy teble
- Next APIのバージョンアップ
- Prev mysql : copy teble
- Next APIのバージョンアップ