[英]SQL query joining tables - Oracle
以示例HR模式為例。 查找沒有LOCATION_ID = 1700的員工時將查詢什么
我已經嘗試過使用內部聯接進行查詢,但是我不知道該怎么做。
結果查詢應該像
select * from employees
inner join departments on
employees.DEPARTMENT_ID=departments.DEPARTMENT_ID
--> and where departments.location_id != '1700'
由於我以HR模式為例。 我想補充一點,在我的原始情況下,location_id是varchar2。
我假設您要在Sql中查詢
select * from employees
inner join departments on
employees.DEPARTMENT_ID=departments.DEPARTMENT_ID
where departments.location_id <> 1700
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.