in sql table follw columns r their
vehicle_no|servicetype|date|location|
1234 |1FS |1-JAN|PUNE|
4561 |2FS |5-JAN|PUNE|
1234 |PS |7-JAN|PUNE|
1234 |PS |15-JAN|MUMB|
i want o/p below
vehicleno|1fs|1fsdate|1fslocation|1ps|1PSDATE|1PSLOC|2PS|2PS
DATE|2PSLOCA
e.g
1234|1FS|1JAN|PUNE|1PS|7JAN|PUNE|2PS|15JAN|MUMBAI

PLS help me out to execute using sql query



in sql table follw columns r their vehicle_no|servicetype|date|location| 1234 |1FS |1-..

Answer / mathivanan

select listagg(vehicle_no||'|'||servicetype||'|'||date||'|'||location,'|') within group (order by vehicle_no) from table_name

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

How to perform a loop through all tables in pl/sql?

4 Answers   Evosys, MBT,


Name the different types of indexes in sql and define them.

0 Answers  


1. what is the exact use of hint in sql. 2. How we can avoid index scan in sql even though index is there in the table.

1 Answers   Polaris,


What are the steps you take to tune(performance tuning) the code in plsql?

4 Answers   Cap Gemini, Infosys, TCS,


Is primary key clustered index?

0 Answers  






Explian rowid, rownum? What are the psoducolumns we have?

0 Answers  


Can we create table in function?

0 Answers  


What is the difference between inner join and left join?

0 Answers  


Can a table contain multiple foreign key’s?

0 Answers  


What is pl sql script?

0 Answers  


How many sql commands are there?

0 Answers  


Why left join is used in sql?

0 Answers  


Categories