Click to See Complete Forum and Search --> : Help with Oracle query


Luna_Etoile
October 17th, 2004, 07:30 AM
Ok, hello, I'm very new to Oracle, and am finding it hard to get the jist of it, my question
may seem simple to you guys but I would really appreciate some help. I need to know Oracle
for University, and I really hate it at the moment.

(I'm told we are using the
very latest version of oracle, if that makes any difference)

So here goes.

There are two tables,
Emp - It holds - Empno, Ename, Job, Mgr, Hiredate, Sal, Comm, Deptno
Dept - It holds - Deptno, Dname, Loc

(Dept=department)
(Emp=employee)

I need to find the name, salary and location of all salesmen.

People with different Jobs have the same Deptno, so I can't do it by specifying a department
number.

Thank you.

sasi242
October 19th, 2004, 03:17 AM
Hi

Check This

SQL> select ename,sal,loc from emp,dept where emp.deptno=dept.deptno and job='SALESMAN';

ENAME SAL LOC
---------- ---------- -------------
ALLEN 1600 CHICAGO
WARD 1250 CHICAGO
MARTIN 1250 CHICAGO
TURNER 1500 CHICAGO

Happy Coding
Sasi242@yahoo.com

Luna_Etoile
October 19th, 2004, 08:41 AM
Thankyou!!!