11int.mql 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. -- ============================================================
  2. -- int 类型搜索测试
  3. -- ============================================================
  4. -- 1. 等值搜索
  5. select * from /test/aaa/test_search where s_int=10
  6. /**
  7. output()
  8. count(1)
  9. match("s_name","search_int_001")
  10. **/
  11. ;
  12. -- 2. 大于搜索
  13. select * from /test/aaa/test_search where s_int>20
  14. /**
  15. output()
  16. match("search_int_003")
  17. match("search_int_004")
  18. match("search_int_005")
  19. **/
  20. ;
  21. -- 3. 小于搜索
  22. select * from /test/aaa/test_search where s_int<20
  23. /**
  24. output()
  25. match("search_int_001")
  26. **/
  27. ;
  28. -- 4. 大于等于搜索
  29. select * from /test/aaa/test_search where s_int>=50
  30. /**
  31. output()
  32. match("search_int_004")
  33. match("search_int_005")
  34. **/
  35. ;
  36. -- 5. 不等于搜索
  37. select * from /test/aaa/test_search where s_int!=10
  38. /**
  39. output()
  40. **/
  41. ;
  42. -- 6. 搜索不存在的值
  43. select * from /test/aaa/test_search where s_int=99999
  44. /**
  45. output()
  46. count(0)
  47. **/
  48. ;
  49. -- 7. 搜索负数 (插入测试数据)
  50. insert into /test/aaa/test_search (s_name, s_text, s_int) values ('search_neg_001', 'negative int test', -100)
  51. ;
  52. select * from /test/aaa/test_search where s_int=-100
  53. /**
  54. output()
  55. count(1)
  56. **/
  57. ;
  58. -- 8. 搜索零值
  59. select * from /test/aaa/test_search where s_int=0
  60. /**
  61. output()
  62. count(0)
  63. **/
  64. ;