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

spool su file .csv usando for loop

Non sono necessarie 4 query diverse, basta elencare tutte le partizioni nella query:

set linesize 1000
set feedback off
set underline off
spool C:\Users\file.csv replace
SELECT cust_no FROM customer PARTITION (customer_PR1, customer_PR2, customer_PR3, customer_PR4)
        WHERE city='ba' AND first_name='john'
        AND salary=1000;
spool off;