Database Administration (MOSC)

MOSC Banner

Formating output and combining queries

edited Oct 28, 2011 11:25PM in Database Administration (MOSC) 2 comments
I've to print the result of these SQLs into 4 columns so that the text file can be imported into MS Excel.

SQL> select min(timestamp),count(*) from dba_audit_trail where trunc(timestamp) between sysdate-365 and sysdate;

MIN(TIMES   COUNT(*)
--------- ----------
29-OCT-10      93480

SQL> select count(*) from dba_audit_trail where trunc(timestamp) between sysdate-365 and sysdate;

  COUNT(*)
----------
     93480

SQL> select count(*) from dba_audit_trail where trunc(timestamp) between sysdate-30 and sysdate;

  COUNT(*)
----------
        10
I need this output

Col1                Col2               Col3         Col4

29-OCT-10      93480          93480         10

Can you please help ?

Thanks

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center