Re: 分類付き m_byochu

このトピックの投稿一覧へ

なし Re: 分類付き m_byochu

msg# 1.3.2.1
depth:
3
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2010.11.03 12:04 | 最終変更
OhYeah!  管理人   投稿数: 983 オンライン
害獣例外処理の落ちがあったので、修正版です。

--/d
drop table if exists t_byochu;
create temp table t_byochu as select distinct byochu from m_tekiyo order by byochu;
drop table if exists m_byochu;
create table m_byochu (idbyochu integer primary key autoincrement, byochu varchar unique, cid integer);
begin transaction;
insert into m_byochu (byochu, cid) select byochu, 0 from t_byochu where ifnullstr(byochu, '-') != '-';
update m_byochu set cid = 4 where byochu in (select distinct byochu from m_tekiyo where mokuteki = '忌避' or bango in (select bango from m_kihon where koka like '%忌避%'));
update m_byochu set cid = 3 where byochu in (select distinct byochu from m_tekiyo where mokuteki in ('誘引', '交尾阻害') or bango in (select bango from m_kihon where yoto like '殺虫%' or koka like '%誘引' or koka like '%殺虫%'));
update m_byochu set cid = 3 where byochu like '%ナメクジ';
update m_byochu set cid = 1 where byochu like '%雑草%' or byochu in (select distinct byochu from m_tekiyo where bango in (select bango from m_kihon where yoto = '除草剤'));
update m_byochu set cid = 2 where byochu like '%病%' or byochu like'%症%' or byochu like '%菌%' or byochu like '%腐%' or byochu like '%タケ';
update m_byochu set cid = 0 where byochu like '活性化%' or byochu like '%覚醒%';
update m_byochu set cid = 4 where byochu in ('イノシシ', 'カモシカ', 'ニホンジカ', 'モグラ', '野ウサギ', '野ソ', '害獣');
commit;
drop table if exists t_byochu;
投票数:0 平均点:0.00

投稿ツリー

  条件検索へ