Re: Is this possible with SQL in SQL PLUS?

From: milan <mpopov_at_cg.yu>
Date: Thu, 6 Sep 2001 08:27:51 +0200
Message-ID: <1004858566.346379_at_tvrdi.cg.yu>


Try this:

set head off
select

     L.temp1 || chr(9) || R.temp1 || chr(10)
     || L.temp2 || chr(9) || R.temp2 || chr(10)
     ...
     || L.temp60 || chr(9) || R.temp60

from TABLE_TEMP L, TABLE_TEMP R
where L.the_date = R.the_date
 and L.the_date = to_date( ...)

chr(9) is 'tab', while chr(10) is 'new line'.

Milan Popov

"Pierre Charpenay" <pierre.charpenay_at_unilog.fr> wrote in message news:3B8E1F10.1FB8A1AA_at_unilog.fr...
> You can try something like that :
>
> select
> L.temp1 || ' ' || R.temp1 || '
> ' || L.temp2 || ' ' || R.temp2 || '
> ...
> ' || L.temp60 || ' ' || R.temp60
> from TABLE_TEMP L, TABLE_TEMP R
> where L.the_date = R.the_date
> and L.the_date = to_date( ...)
>
> Each line of the select part must end (except the last) and start
> (except the first) with a quote (so the carriage return and/or new line
> is included in the single column definition).
> This works with SQL*Plus on Unix.
>
> Hope this helps.
>
> johan a écrit :
> >
> > ...
> > So i store every five minutes 2 records in a table with fields
> > date, L (= left side of furnace), temp1, temp2, .........., temp60
> > date, R (=right side of furnace), temp1, temp2, ........, temp60
> >
> > When the user enters a date,time i want to show fields of the two
records
> > from that date,time in following format :
> > left temp1 right temp1
> > left temp2 right temp2
> > .... .....
> > left temp60 right temp60
> >
> > Is this possible with a simple query from sql plus or does one have to
> > program in PL/SQL to accomplish this?
> >
> > Friendly regards
> > Johan
>
> --
> Pierre CHARPENAY
Received on Thu Sep 06 2001 - 08:27:51 CEST

Original text of this message