-
Notifications
You must be signed in to change notification settings - Fork 0
/
wtf.sql
executable file
·74 lines (62 loc) · 1.85 KB
/
wtf.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
--select * from word where spell <> prototype and prototype <> '' order by prototype
--update word set spell = prototype where spell <> prototype and prototype <> '' order by prototype
--select sum(frequency), spell from word group by spell
/*
UPDATE
word AS w
LEFT JOIN (
SELECT
SUM(frequency) AS total,
spell
FROM
word
GROUP BY
spell
) AS m ON
m.spell = w.spell
SET
w.frequency = m.total
*/
-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2011 年 07 月 26 日 11:07
-- 服务器版本: 5.1.41
-- PHP 版本: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- 数据库: `wtf`
--
-- --------------------------------------------------------
--
-- 表的结构 `word`
--
DROP TABLE IF EXISTS `word`;
CREATE TABLE IF NOT EXISTS `word` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`spell` varchar(50) NOT NULL,
`prototype` varchar(50) NOT NULL,
`frequency` int(11) NOT NULL,
`phonetic` varchar(50) DEFAULT NULL,
`soundFile` varchar(255) DEFAULT NULL,
`reference` varchar(50) DEFAULT '',
`translate` varchar(155) NOT NULL,
`tags` varchar(50) DEFAULT '',
`detail` text DEFAULT '',
`json` text NOT NULL,
`category` int(2) DEFAULT 0,
`store_date` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- 转存表中的数据 `word`
--
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;