Femme Fatale
Femme Fatale

Reputation: 880

SQL query joining tables - Oracle

Take an example from sample HR schema. What would be query for finding employees which do not have LOCATION_ID = 1700
I have tried a query using inner join but i don't know how to go further.
The resulting query should something be like

select * from employees
inner join  departments on
    employees.DEPARTMENT_ID=departments.DEPARTMENT_ID
-->  and where departments.location_id != '1700'

Since i am taking HR schema as an example. I would like to add that in my original case location_id is a varchar2.

Upvotes: 0

Views: 468

Answers (1)

DevelopmentIsMyPassion
DevelopmentIsMyPassion

Reputation: 3591

I assume you want query in Sql

select * from employees
    inner join  departments on
      employees.DEPARTMENT_ID=departments.DEPARTMENT_ID
where departments.location_id <> 1700

Upvotes: 5

Related Questions