Skip to main content

Comparison Operators

OperatorNameExampleUse Case
==EqualsCity == 'Mumbai'Exact matches
!=Not EqualsStatus != 'Inactive'Exclude specific values
>Greater ThanpaidUpCapital > 1000000Minimum thresholds
<Less ThanTurnover < 10000000Upper limits
>=Greater Than or EqualnumberOfDirectors >= 3Minimum inclusive
<=Less Than or EqualnumberOfDirectors <= 10Maximum inclusive

Text Operators

OperatorNameExampleUse Case
CONTAINSContainscompanyName CONTAINS 'Tech'Substring search
STARTS_WITHStarts WithcompanyName STARTS_WITH 'Infosys'Prefix matching

List Operators

OperatorNameExampleUse Case
INIn ListCity IN ['Mumbai', 'Delhi']Multiple value matching
NOT INNot In ListState NOT IN ['Maharashtra']Exclude multiple values
Using IN is more efficient than multiple OR conditions:Better:
City IN ['Mumbai', 'Delhi', 'Bangalore']
Avoid:
City == 'Mumbai' OR City == 'Delhi' OR City == 'Bangalore'

Logical Operators

OperatorNameExample
ANDLogical ANDCity == 'Mumbai' AND State == 'Maharashtra'
ORLogical ORCity == 'Mumbai' OR City == 'Delhi'

Operator Precedence

AND has higher precedence than OR. Use parentheses to control evaluation:
# This evaluates as: A OR (B AND C)
A OR B AND C

# Use parentheses to change order: (A OR B) AND C
(A OR B) AND C

Examples by Operator

# Exact city match
City == 'Mumbai'

# Exact status match
llpStatus == 'Active'

# Company type match
classOfCompany == 'Private'
# Exclude inactive companies
llpStatus != 'Inactive'

# Exclude struck off companies
llpStatus != 'Struck Off'
# Companies with capital over 1 crore
paidUpCapital > 10000000

# Companies with capital up to 50 lakhs
paidUpCapital <= 5000000

# Companies incorporated after 2020
dateOfIncorporation > '2020-01-01'
# Companies with 'tech' in name
companyName CONTAINS 'tech'

# IT sector companies
NICDesc CONTAINS 'software'
# Multiple cities
City IN ['Mumbai', 'Delhi', 'Bangalore']

# Multiple NIC codes
NICCode IN [62011, 62012, 62013]

# Exclude certain states
State NOT IN ['Maharashtra', 'Karnataka']
# Both conditions required
City == 'Mumbai' AND paidUpCapital > 10000000

# Either condition
City == 'Mumbai' OR City == 'Delhi'

# Complex combination
(City == 'Mumbai' OR City == 'Delhi') AND paidUpCapital > 10000000