in sql table following column r there
i want find 1st paid ,2nd paid,3rd paid date for same
|service_type|date |vehicle_no|
|------------|------|_---------|
|paid |23 jan|MH12H2007 |
| | | |
|paid |26 feb|MH12H2007 |
| | | |
| | | |
|paid |28 mar|MH12H2007 |
i want o/p like below
vehicle no| 1st paid date | 2nd paid date|3rd paid |latest
paid date|

pls help me out

Answer Posted / sudipta santra

select distinct service_type,date,vehicle_no from
vehicle_service
where vehicle_no='MH12H2007' and service_type='paid' and
rownum<4
order by date desc

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between procedure and trigger?

510


What are the disadvantages of file system?

609


How to rename a column in the output of sql query?

528


What is meant by cursor in sql?

536


Is it possible to update views?

532






What is the difference between python and sql?

517


What is the maximum size of sqlite database?

542


How do you add a column to a table?

594


What are the different sql languages?

532


What is a system versioned table?

522


What packages(if any) has oracle provided for use by developers?

5014


tell us something about heap tables. : Sql dba

591


Explain ttitle and btitle.

666


What is execute immediate?

542


what are the different functions in sorting an array? : Sql dba

576