user3460603
user3460603

Reputation: 1

SQL Queries not fetching records often while using SQL developer?

I recently tried my hand at SQL. There was a query requirement where I had to list "9. Display the empno, ename, job, hiredate, exp of all the Mgrs". I typed

select EMPNO,ENAME,JOB,HIREDATE,(sysdate-hiredate)as Experience
from emp
where JOB ='Manager';

The result, no records fetched. Only the metadata gets displayed.

Previously the other queries are working fine.

Please help!

Upvotes: 0

Views: 955

Answers (1)

Justin Cave
Justin Cave

Reputation: 231691

That doesn't appear to be a SQL Developer issue. The problem appears to be that your query returns 0 rows.

String comparisons in Oracle (barring cases where you've adjusted your session's NLS settings) are case sensitive. There are, realistically, no rows where the job is "Manager". There are, realistically, rows where the job is "MANAGER". You'd need to search for the string with the proper case

SELECT *
  FROM emp
 WHERE job = 'MANAGER'

Upvotes: 1

Related Questions