Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> sql select question

sql select question

From: ayrobins <anthony.robins_at_micromuse.com>
Date: 14 Feb 2003 16:12:57 -0800
Message-ID: <616b69af.0302141612.4b27689f@posting.google.com>


Hi guys,

this should be easy but i cannot figure out how to do this. The purpose of this is to create a view out of a name/value table and make each name a column.

create table tst
(

	a integer,
	n varchar(10),
	v varchar(10)

);
insert into tst values(1, 'name1a', 'value1a');
insert into tst values(1, 'name1b', 'value1b');
insert into tst values(2, 'name2a', 'value2a');
insert into tst values(2, 'name2b', 'value2b');

select a, v from tst where a in (1);

which gives me:

         A V
---------- ----------

         1 value1a
         1 value1b

What i want is to put the values associated with the same 'a' on 1 row. So i want to see 1 row consisting of '1, value1a, value1b'.

thanx in advance
anthony Received on Fri Feb 14 2003 - 18:12:57 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US