Select Rows as Columns..


Posted on 16th Feb 2014 07:03 pm by admin

is there a way to select COLUMN_NAME from user_tab_columns where table_name='TABLENAME';
and have the output as:
COL1, COL2, COL3
instead of:
COL1,
COL2,
COL3

I'd actually like this full statement to be viewed as:
select COLUMN_NAME,DATA_TYPE,DATA_LENGTH,DATA_PRECISION,DATA_SCALE,NULLABLE from user_tab_columns where table_name='EMP';

EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO
NUMBER,VARCHAR2,VARCHAR2,NUMBER,DATE,NUMBER,NUMBER,NUMBER
22,10,9,22,7,22,22,22
......ect.........

No comments posted yet

Your Answer:

Login to answer
327 Like 34 Dislike
Previous forums Next forums
Other forums

isset undefined variable
Hi all,

Hope someone can point out the obvious. I've a log in script, if you dont enter a use

php wont update my db
hello,

sorry for posting in mysql forum but i dont know where exactly is the problem but here

add 20 000 to the rowcnt
Hi ...
I need to add 20 000 to the row count but just cant find a way to do this i am new to php

Using CSS to format MySQL query
Hi,

If i want to have a news page on my site, which displays all records of a table in descen

ORA-01655: unable to extend cluster SYS.C_FILE#_BLOCK# by 128
Hi all,

Oracle 10g. Linux.

I'm facing the below error while trying to import a dumpfil

error checking breaking my code
Hi there, OK first of all, big apologies for what I assume is really fundamental errors in the struc

Help Import Animoto and Youtube
CAn someone help me urgently want to allow users on my website to import youtube/revver/dailymotion

update 2 columns by doing inner 2-column query
Hi,
is something like this possible?

update contract_all set col1,col2 =
(

PHP arrays into arrays need help
Hello
I am trying to highlight the days on my calendar based on the dates that i have in my datab

Slashes
Have a small problem and I'm not able to understand why I'm getting the results I'm getting... and i

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash