H
himoo
Unregistered / Unconfirmed
GUEST, unregistred user!
求个函数。。。<br>+代表或 ,-代表否,*代表和<br>比如用户可以输入:<br>1. 火车+汽车<br>2. 火车+汽车-飞机<br>3. (火车+汽车)*飞机<br>4. (飞机*大炮)+(小米*步)<br>等等(检索式不带序号和后面的点、空格)<br><br>通过一个函数 可以转化成:<br><br>1. SQL.text='Select count(*) from table where CONTAINTS(field, ' + #39 + '火车' + #39 + ')' or CONTAINTS(field, ' + #39 + '汽车' + #39 + ')'<br><br><br>2. SQL.text='Select count(*) from table where CONTAINTS(field, ' + #39 + '火车' + #39 + ')' or CONTAINTS(field, ' + #39 + '汽车' + #39 + ')' and not CONTAINTS(field, ' + #39 + '飞机' + #39 + ')'<br><br>3. SQL.text='Select count(*) from table where (CONTAINTS(field, ' + #39 + '火车' + #39 + ')' or CONTAINTS(field, ' + #39 + '汽车' + #39 + ')') and CONTAINTS(field, ' + #39 + '飞机' + #39 + ')'<br><br><br>4. SQL.text='Select count(*) from table where (CONTAINTS(field, ' + #39 + '飞机' + #39 + ')' and CONTAINTS(field, ' + #39 + '大炮' + #39 + ')') or (CONTAINTS(field, ' + #39 + '小米' + #39 + ')' and CONTAINTS(field, ' + #39 + '步' + #39 + ')')