Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Can you do multiple joins in sql?

1120


What is an oracle stored procedure?

1115


What is union and union all keyword in sql and what are their differences?

1157


What are the basic techniques of indexing?

1111


How can we debug in PL/SQL?

1187


Why do we create views in sql?

1217


What is trigger explain with example?

1092


Can one improve the performance of sql*loader? : aql loader

1099


what is log shipping? : Sql dba

1165


Inline the values in PL/SQL, what does it mean.?

1275


What action do you have to perform before retrieving data from the next result set of a stored procedure ?

2610


What is difference between sql function and stored procedure?

1063


what does it mean to have quoted_identifier on? : Sql dba

1181


How do you explain an index?

1330


What is clause in sql?

1178