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

Oracle FETCH FIRST 1 ROW con istruzione UNION ALL

Metti ogni parte tra parentesi. Funziona in 12.2, comunque:

( Select * From tabl1 where Date = '04-MAR-2020' FETCH FIRST 1 ROW )
UNION ALL
( Select * From tabl1 where Date = '05-MAR-2020' FETCH FIRST 1 ROW )

La mia vera domanda di prova, per chiunque fosse interessato era questa:

(select   object_name 
 from     user_objects 
 where    object_type = 'TABLE' 
 order by object_name 
 fetch first 1 row only)
UNION ALL
(select   object_name 
 from     user_objects 
 where    object_type = 'VIEW' 
 order by object_name 
 fetch first 1 row only);