Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • check_copy_progress.sh Linux/Unix
  • S3 Basic info AWS
  • shutdown linux Linux/Unix
  • Oracle vs MYSQL Architecture differences (For DBAs) MYSQL
  • Difference between SYNC and AFFIRM Oracle
  • Another Tuning Article for subheap of shared pool Oracle
  • How to choose Driver table in SQL statement Oracle
  • Metalink Note: Note:250655.1 : ADDM Basics USING THE AUTOMATIC DATABASE DIAGNOSTIC MONITOR Oracle
  • To find all disk io ( EMC as well as local) Linux/Unix
  • Specify the Rollback segment to use in Transaction Oracle
  • Changing default shell Linux/Unix
  • Processes parameter and its dependencies on OS kernel parameters Linux/Unix
  • To Find Orphan OS processes. Linux/Unix
  • How to know current SID Oracle
  • Find Command Linux/Unix

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

  • crtgr.sql /* For creating trigger from data dictionary */ Oracle
  • ORA-1841 Error Connecting to Upgraded Database After Set PASSWORD_LIFE_TIME Oracle
  • Rman Notes -1 Oracle
  • Locally Managed Tablespace and Dictionary managed tablespace (LMT-DMT) Oracle
  • 339939.1 Running Cluster Verification Utility to Diagnose Install Problems Oracle
  • Oracle 10g Installation/Applying Patches Tips Oracle

Leave a Reply Cancel reply

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

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (394)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (343)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Default User Profile Oracle
  • Optimizer_Index init.ora parameter explaination. Oracle
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • get_aix_vmstat.ksh Oracle
  • Unix split command to split files Linux/Unix
  • JSON/XML Types in Oracle Oracle
  • All About oracle password and security from metalink Oracle
  • Oracle Recommended Patches — Oracle Database ID 756671.1 Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme