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
what are the security recommendations while using mysql? : Sql dba
How can we optimize a sql query?
What are pl/sql cursor exceptions?
What is clustered index in sql?
what happens if you no create privilege in a database? : Sql dba
What is keys and its types?
What are the different types of a subquery?
What is the main difference between sql and pl/sql?
What are the differences between in and exists clause?
In what condition is it good to disable a trigger?
Explain character-manipulation functions?
What are different clauses used in sql?
Explain constraints in sql?
Which constraints we can use while creating database in sql?
What is index example?