Hi !
I have two questions regarding SELECT statement.
1. If I do SELECT statement, I get each fields in a record in
seperate row:
MYID 1
MYNAME Name
MYID 2
MYNAME Name2
...
I would like to get output like:
MYID MYNAME
1 Name
2 Name2
...
How to change that
2. I would like to replace field name with something else
like
SELECT "Id:"=MYID,"Name:"=MYNAME FROM TABLE (this works in SyBase)
Id Name
1 Name
2 Name2
Alex
↪ replying to Marvin
On Mon, 28 Feb 2000 13:59:48 +0100, Marvin <ales.romaniuk@zag.si>
wrote:
>Hi !
>
>I have two questions regarding SELECT statement.
>
>1. If I do SELECT statement, I get each fields in a record in
> seperate row:
> MYID 1
> MYNAME Name
>
> MYID 2
> MYNAME Name2
> ...
>
> I would like to get output like:
> MYID MYNAME
> 1 Name
> 2 Name2
> ...
>
> How to change that
I not found any standart possibility to change this.
But exists several utilities to reformat this. try www.iiug.org
Or if you have isql, write report for this.
I look at iiug and found this for you:
col2rows: Reformats SQL output from columns to rows [PERL]
reform_sql: Reformats ISQL output to 1 wide line per row [AWK]
from http://www.iiug.org/software/index_ISQL.html
>2. I would like to replace field name with something else
> like
> SELECT "Id:"=MYID,"Name:"=MYNAME FROM TABLE (this works in SyBase)
SELECT MYID Id,
MYNAME AS Name (AS is optional keyword)
FROM TABLE
> Id Name
> 1 Name
> 2 Name2
--
Jiří Lisický ČD DATIS Olomouc
e-mail: lisicky@datis.cdrail.cz Nerudova 1
phone: +420-068-472-5496 Olomouc, Czech Republic
>>> čeština ISO-8859-2 Compatible <<<