Sometimes you may want to view the data that equal to something or greater than, less than something or opposite to something. You can filter data conditionally from a table or query by using the operators listed below.
|=||Equal condition||ProductName = 'ANCHOR'|
|<||Less than condition||Quantity<20|
|<=||Less than or equal condition||Quantity<=50|
|>||Greater than condition||Price>40|
|>=||Greater than or equal condition||Price>=40|
|<>||Opposite or not equal condition||ProductName<>'Angkor'|
|And||Combining conditions and it returns true if all conditions are true.||Quanity>20 And UnitPrice <15|
|Or||Combining conditions and it works if which conditions is true.||Quanity >20 Or UnitPrice<15|
|Like||Matching a pattern condition||ProductName Like 'C*'|
|Between||Determining the value between value1 and value2||UnitPrice Between 15 and 23|
|In||Matching a collection of values||ProductName In('ABC', 'LOVE')|
|Not||Opposite condition||Not Quantity >20|
|Is Null||Monitoring Null Value||Address Is Null|
Ex1: You want to display all female students. To do so, follow the figure below:
Ex2: You want to display the product names starting with C letter.
Ex3: You want to show the customers that live in Phnom Penh city or Kandal province.
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: