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: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
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: Fri Feb 07 18:12:03 CST 2025