func_equal.test
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:1k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. #
  2. # Testing of the <=> operator
  3. #
  4. #
  5. # First some simple tests
  6. #
  7. select 0<=>0,0.0<=>0.0,"A"<=>"A",NULL<=>NULL;
  8. select 1<=>0,0<=>NULL,NULL<=>0;
  9. select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0;
  10. select "A"<=>"B","A"<=>NULL,NULL<=>"A";
  11. #
  12. # Test with tables
  13. #
  14. drop table if exists t1,t2;
  15. create table t1 (id int, value int);
  16. create table t2 (id int, value int);
  17. insert into t1 values (1,null);
  18. insert into t2 values (1,null);
  19. select t1.*, t2.*, t1.value<=>t2.value from t1, t2 where t1.id=t2.id and t1.id=1;
  20. select * from t1 where id <=>id;
  21. select * from t1 where value <=> value;
  22. select * from t1 where id <=> value or value<=>id;
  23. drop table t1,t2;