Home » SQL & PL/SQL » SQL & PL/SQL » Join and select help
Join and select help [message #396558] Tue, 07 April 2009 03:52 Go to next message
greg27
Messages: 1
Registered: April 2009
Junior Member
I have a query like this:

SELECT  Employees.Names
FROM    Employees, Transactions
WHERE   Employees.Staff_No = Transactions.Staff
MINUS
SELECT  Employees.Names
FROM    Employees, Jobs, Authority
WHERE   Employees.Category = Jobs.Id
AND     Jobs.Id = Authority.Id;


Basically I'm trying to get a list of employees who performed a transaction that they're not authorised to do. My problem is that, unless I select a column from the Transactions table in the first query and a column from the Authority table in the second query, I don't get the results I need. However I only want the statement to the Names column from the employees table.

Any ideas?

Cheers.
Re: Join and select help [message #396606 is a reply to message #396558] Tue, 07 April 2009 05:48 Go to previous message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I don't get the results I need

How could we know when we don't know your model and data?

Regards
Michel
Previous Topic: ORA 600 error
Next Topic: How To reterive the record counts
Goto Forum:
  


Current Time: Wed Dec 07 18:45:07 CST 2016

Total time taken to generate the page: 0.09113 seconds