Need guidance towards evaluative boolean logic tree

前端 未结 5 1363
没有蜡笔的小新
没有蜡笔的小新 2021-02-04 16:29

I can\'t seem to find a pointer in the right direction, I am not even sure what the terms are that I should be researching but countless hours of googling seem to be spinning me

5条回答
  •  星月不相逢
    2021-02-04 17:09

    These kinds of queries are often presented as an ORed array of ANDed clauses. That is, a tabular format in which you read across multiple conditions ANDed together, and then read down to OR them. That leads to some repetition of conditions, but is easy for users to read, write, and understand. Your sample ((Sex == Male AND Age == 25) OR (Sex == Female AND Status == Single)) AND IQ > 120 would look like

    Sex == Male   & Age == 25        & IQ > 120 
    Sex == Female & Status == Single & IQ > 120 
    

提交回复
热议问题