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

Vælg fra tabel, hvis posten findes i en anden tabel

Du kan gøre sådan noget:

-- If value is found in table2, select from table1 select * -- <- use padding if necessary from table1 where exists (select 1 from table2 where myField = value) union all -- If value is not found in table2, select from another_Table select * -- <- use padding if necessary from another_Table where not exists (select 1 from table2 where myField = value)

  1. Hvordan FROM_BASE64() virker i MariaDB

  2. AOL/J Setup Test suite

  3. Hvordan opretter man forbindelse til mssql ved hjælp af pdo gennem PHP og Linux?

  4. Vil du inkludere overskrifter, når du bruger SELECT INTO OUTFILE?