I am not able to make this out: Between eliminates use of >= and <=
…but when i tried this query:
SELECT *
FROM names
WHERE name >= 'Ankit'
AND name <= 'P'
…it gives output:
name
------
Ankit
Mac
Bob
When I tried:
SELECT *
FROM names
WHERE name BETWEEN 'Ankit' AND 'P'
…it gives output:
name
------
Ankit
Can you explain this why?
First, Oracle VARCHAR2 type is case sensitive.
Second, check that you do not have spaces in the beginning of name like this:
Use trim function to check if this causes the problem:
If this does not help, check that language and sort order are correct for your database.
Edit:
Since above advice did not solve your problem, you could try following:
Maybe you have some other non-printable characters in field. Use Oracle
DUMPfunction to check:You should get something like this:
Verify that
Lenis correct length.Check NLS parameters so that they are not inadvertently changed to something that does not work for your database:
Check results of these three queries and verify that parameters on sort, language and character set are correct.