Toad World® Forums

Question on a SQL stmt in TOAD for Oracle

When I code the following SQL stmt I do not get the correct result set.

select ascii(city) , city from customers
where city <='C';

the result set does not include any city that begins with 'C'.
If I recode it as
Select ascii(city), city
from customers
where substr(city,1,1)<='C';

I get the correct result set.Why is this since the ascii(city) for
city='C' is correct.
This example uses the Northwind database tables.

If you had a city named "C" that would work. But "Chicago", for example, is greater than "C".

If I were looking for cities that began with C, I would do:

where city like 'C%'