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 / vijay_1994
with temp as (select
service type,
paid,
vechile no,
dense_rank()over(order by date asc) as a
from table
select * from temp where a<=3;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a string data type in sql?
How do I trace sql profiler?
What is the importance of sqlcode and sqlerrm?
What is foreign key in sql with example?
What are aggregate functions in sql?
What is a parameter query?
How to handle bulk data?
What does cursor do in sql?
What is record in pl sql?
Can you upgrade sql express to full sql?
What is pl sql in oracle?
Where is pl sql used?
Is sql a programming?
How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000
What is the maximum number of columns in sql table?