SQL select query example to convert rows to column :
select sum(case when EMP_ID=1 then 1 else 0 END) "Pantry" ,sum (case when EMP_ID=2 then 1 else 0 END) "Security" from EMP_TABLE where to_char(JOIN_DATE,'DD-MM-YY')='10-11-12';
SQL select case query example :
select case when EMP_ID=1 then 'Pantry' when EMP_ID in (2,3) then 'Security' END from EMP_TABLE where to_char(JOIN_DATE,'DD-MM-YY')='10-11-12';
SQL select statement example comma seperated delimiter display
select EMP_ID||','||JOIN_DATE from EMP_TABLE;
SQL select statement example to combine data from two different tables
select * from EMP_TABLE_1 union all select * from EMP_TABLE_2;
select sum(case when EMP_ID=1 then 1 else 0 END) "Pantry" ,sum (case when EMP_ID=2 then 1 else 0 END) "Security" from EMP_TABLE where to_char(JOIN_DATE,'DD-MM-YY')='10-11-12';
SQL select case query example :
select case when EMP_ID=1 then 'Pantry' when EMP_ID in (2,3) then 'Security' END from EMP_TABLE where to_char(JOIN_DATE,'DD-MM-YY')='10-11-12';
SQL select statement example comma seperated delimiter display
select EMP_ID||','||JOIN_DATE from EMP_TABLE;
SQL select statement example to combine data from two different tables
select * from EMP_TABLE_1 union all select * from EMP_TABLE_2;