Re: SQL*PLUS select statment



sunadmn wrote:
Afternoon all I have a simple query that I am running to get a dataset
for BIRT. The query runs fine but I need to manipulate the data into a
single column; Here is an example:

SQL> select
ONLINEFX.EVERYDAY_SUMMARY.COUNT,ONLINEFX.EVERYDAY_SUMMARY.GOOD_COUNT,ONLINEFX.EVERYDAY_
SUMMARY.FAIR_COUNT,ONLINEFX.EVERYDAY_SUMMARY.UNACCEPTABLE_COUNT
2 from ONLINEFX.EVERYDAY_SUMMARY
3 where ONLINEFX.EVERYDAY_SUMMARY.PERIOD = to_char(sysdate-1, 'YYYY-
MM-DD');

COUNT GOOD_COUNT FAIR_COUNT UNACCEPTABLE_COUNT
---------- ---------- ----------
------------------
6577 6146 91 340

I want to have the data returned in the format of multiple rows and a
single column like this:

COUNT 6577
GOOD_COUNT 6146
FAIR_COUNT 91
UNACCEPTABLE_COUNT 340


I know this has to be possible, but I lack the SQL skill to get to
where I need to be if anyone could give me some pointers or point me
to a good ref doc that would be great.

Cheers,
-Steve

Morgan's Library at www.psoug.org
Look up DECODE.
--
Daniel A. Morgan
University of Washington
damorgan@xxxxxxxxxxxxxxxx
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
.



Relevant Pages

  • Re: SQL*PLUS select statment
    ... single column; Here is an example: ... I know this has to be possible, but I lack the SQL skill to get to ... The two decodes 'join' the RN from query b) to query a), ... I tend to agree with Sybrand - the produced resultset is triple faked. ...
    (comp.databases.oracle.misc)
  • Re: Function Using Select Case for Query
    ... Okay, I'm completely baffled. ... name a column in your query, but you never manipulate a query's SQL ...
    (microsoft.public.access.modulesdaovba)
  • SQL*PLUS select statment
    ... Afternoon all I have a simple query that I am running to get a dataset ... The query runs fine but I need to manipulate the data into a ... single column; Here is an example: ... I know this has to be possible, but I lack the SQL skill to get to ...
    (comp.databases.oracle.misc)
  • Re: Fulltext syntax questions
    ... In SQL 2005 you do it like this ... in SQL 2000 you can query a single column by name or all fulltext indexed ... How do i search multiple columns in multiple tables. ...
    (microsoft.public.sqlserver.fulltext)
  • Re: SQL*PLUS select statment
    ... for BIRT. ... The query runs fine but I need to manipulate the data into a ... single column; Here is an example: ...
    (comp.databases.oracle.misc)