troubleshooting Question

ORACLE 11G RETURNING A RESULTSET IF BOTH CONDITIONS ARE TRUE IN DIFFERENT ROWS

Avatar of cookiejar
cookiejarFlag for United States of America asked on
Oracle Database
6 Comments1 Solution257 ViewsLast Modified:
Table
Empid          City                    Type                  Status
1245              Dallas               OrderTo          CheckedOut
1245              New York         CheckedIn    InTransit
1111               Dallas               CheckedIn     Temporary
 1439               Dallas               OrderTo        CheckedOut
  1439             New York         CheckedIn    InTransit
  1880             DeRidder          OrderTo       CheckedOut
   1883            Coushata          CheckedIn   InTransit

When  given two Cities, for example,  Dallas and New York
From these input I need to bring back the Empid that meets the following requirement:

Both must be true:
Their type and status must  OrderTo and CheckedOut for Dallas and
their type and status must be CheckedIn and Intranist for New York

In this case my result set would be:
  1245
   1439

How would  I construct the SQL to bring back this result?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros