Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Oracle 11g Environment Setup Oracle
  • process id based files and processes Linux/Unix
  • sid_wise_sql.sql Further explaination Oracle
  • to see when crontab is changed. Linux/Unix
  • This is im telling Kishore Oracle
  • segment_wise_space.sql segspace.sql Segment wise space usage (allocated and used) Oracle
  • Find_table_size.sql Oracle
  • To check whether standby is recovering properly or not?? Oracle
  • CPU speed on Linux Linux/Unix
  • Find All internal Parameters Oracle
  • Renaming Oracle Instance Name Oracle
  • V$CONTROLFILE_RECORD_SECTION reference notes. Oracle
  • 276434.1 Modifying the VIP or VIP Hostname of a 10g or 11g Oracle Clusterware Node Oracle
  • Rownum with Order by Oracle
  • Kill a session dynanically using execute immediate Oracle

Convert multiple rows to single column

Posted on 13-Sep-202313-Sep-2023 By Admin No Comments on Convert multiple rows to single column

Converting rows to single column:

create table emp ( empno number, empname varchar2(100), deptno number);
insert into emp values( 1, 'emp1', 10);
insert into emp values( 2, 'emp2', 20);
insert into emp values( 3, 'emp3', 30);
insert into emp values( 4, 'emp4', 10);
insert into emp values( 5, 'paresh', 30);
insert into emp values( 6, 'martin', 30);
insert into emp values( 7, 'sri', 10);

select deptno,
rtrim (xmlagg (xmlelement (e, empno || ',')).extract ('//text()'), ',') list_of_empnos
from emp
group by deptno ;

Oracle, SQL scripts

Post navigation

Previous Post: Find all users who have DML privileges
Next Post: Creating never expiring DB user accounts in Oracle

Related Posts

  • get_vmstat_solaris Oracle
  • how to find OS block size Oracle
  • metalink all dynamic view reference notes. Oracle
  • TNSNAMES entries details Oracle
  • sesswait.sql Oracle
  • Adding or Dropping Online Redo Log Files When Physical Standby in place Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • get_vmstat_linux Oracle
  • sqlnet.ora paramters Oracle
  • SCRIPT TO LIST RECURSIVE DEPENDENCY BETWEEN OBJECTS UTLDTREE.sql Oracle
  • move_arch_files.ksh /* Good One */ Linux/Unix
  • Proc code Oracle
  • RMAN : Consistent Backup, Restore and Recovery using RMAN Oracle
  • How to calculate PROCESSES parameter Oracle
  • Optimizer_Index init.ora parameter explaination. Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme