Team Fly 

Page 45

Ask the Expert

Q: Are character searches case-sensitive?

A: Yes. Character columns can contain upper- or lowercase alphas. If we searched the CUSTOMERS table for all instances of ''INL" in the last names, we would not have retrieved any records.

Q: The percent (%) sign appears to be a multicharacter wildcard. Is there a single character wildcard available for pattern searches?

A: Yes. The underscore (_) symbol serves as the single character wildcard.

 

Operator

Purpose

Example

=

Tests for equality.

select * from customers where cust_state_province = 'UT';

!=

Tests for inequality.

select * from customers where cust_state_province != 'UT';

^=

Same as !=.

select * from customers where cust_state_province ^= 'UT';

<>

Same as !=.

select * from customers where cust_state_province <> 'UT';

<

Less than.

select * from sales where amount_sold < 100;

>

Greater than.

 

<=

Less than or equal to.

select * from sales where amount_sold <= 500;

>=

Greater than or equal to.

select * from sales where amount_sold >= 600;

In

Equal to any member in parentheses.

select * from customers where cust_state_province is in ('UT,'CA','TX');

not in

Not equal to any member in parentheses.

select * from customers where cust_state_province is not in ('UT','CA','TX');

Team Fly 
0064