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
Write an sql query to select all records from the table?
what are date and time functions in mysql? : Sql dba
what is the difference between delete and truncate statement in sql? : Sql dba
Explian rowid, rownum?
Does asenumerable execute the query?
how many columns can be used for creating index? : Sql dba
what is 'mysqldump'? : Sql dba
What are analytical functions in sql?
How to know the last executed procedure?
what is sub-query? : Transact sql
What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql
Is inner join faster than left join?
Why is %isopen always false for an implicit cursor?
what is query cache in mysql? : Sql dba
Why trigger is used in sql?