sql >> Database teknologi >  >> RDS >> Oracle

Opret og brug en midlertidig tabel i indlejrede forespørgsler

with
   ALL_DID as (
      select did from t3
      where price > 500000
   ),
   PAIRS as (
      select
         id, t3.did
      from t1
         left join ALL_DID t3
         on t1.did = t3.did
   )
select id from PAIRS
   group by id
   having count(did) = (
      select count(0) from ALL_DID
   )
minus
select id from PAIRS
   where did is null

violin



  1. SQL Server 2016:Opret en database

  2. Parameter.AsString fejler under Oracle/MSSQL - Parameter.Value 2-byte tegn under Oracle

  3. Reducer databasekald for at forbedre webstedets ydeevne

  4. Vælg Databasedetaljer og tabelnavne i iSQL plus