Home » Other » Training & Certification » Request For a Query
icon1.gif  Request For a Query [message #282891] Sat, 24 November 2007 13:24 Go to next message
farook_quisar
Messages: 12
Registered: May 2006
Location: Abu Dhabi
Junior Member

Dear Gurus,
I need a query. I'll give a scenario here.


Emp table:
EmpNo Empname Department
100 Jhon 01
101 Steve 01

Dept Table:
Deptno Dname
01 Account
01 Account

I need the following output:

EmpNo Empname Department
100 John Account
101 Steve Account



Thanks & Regards
Farook Quisar
Re: Request For a Query [message #282892 is a reply to message #282891] Sat, 24 November 2007 13:33 Go to previous messageGo to next message
Frank Naude
Messages: 4581
Registered: April 1998
Senior Member
You need to join the Emp and Dept tables on (Emp.Department = Dept.Deptno).

Please try to write the query yourself and post your attempt here. When done, we will let you know if it's right/ help you further.
Re: Request For a Query [message #283008 is a reply to message #282891] Sun, 25 November 2007 23:17 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

And Out of curiosity ..

why there are two departments with same deptno and name ?

Thumbs Up
Rajuvan
Re: Request For a Query [message #283019 is a reply to message #283008] Sun, 25 November 2007 23:31 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Because there's no primary key on the table (ORA-NPKEY)? Or because we don't see the whole table (ORA-DONTSEE)? Or because it was a bad example (ORA-BADEX)? Or ...
Re: Request For a Query [message #283033 is a reply to message #282891] Mon, 26 November 2007 00:06 Go to previous message
kir_ait
Messages: 198
Registered: November 2007
Location: Bangalore,India
Senior Member

It seems "it was a bad example (ORA-BADEX)"

was'nt it?

Kiran.
Previous Topic: regular expressions
Next Topic: Foreign key problem
Goto Forum:
  


Current Time: Sat Nov 23 17:16:13 CST 2024