fulltext_order_by.test
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:1k
源码类别:
MySQL数据库
开发平台:
Visual C++
- use test;
- DROP TABLE IF EXISTS t1;
- CREATE TABLE t1 (
- a INT AUTO_INCREMENT PRIMARY KEY,
- message CHAR(20),
- FULLTEXT(message)
- ) comment = 'original testcase by sroussey@network54.com';
- INSERT INTO t1 (message) VALUES ("Testing"),("table"),("testbug"),
- ("steve"),("is"),("cool"),("steve is cool");
- # basic MATCH
- SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve');
- # MATCH + ORDER BY (with ft-ranges)
- SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
- # MATCH + ORDER BY (with normal ranges) + UNIQUE
- SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
- # MATCH + ORDER BY + UNIQUE (const_table)
- SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
- # ORDER BY MATCH
- SELECT a, MATCH (message) AGAINST ('steve') as rel FROM t1 ORDER BY rel;
- drop table t1;