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

Answers were Sorted based on User's Feedback



in sql table following column r there i want find 1st paid ,2nd paid,3rd paid date for same |servi..

Answer / 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

in sql table following column r there i want find 1st paid ,2nd paid,3rd paid date for same |servi..

Answer / vinay

friend i want o/p for multiple vehicle_no where service type
are different i.e paid ,first free,second free,third free
pls help

Is This Answer Correct ?    0 Yes 0 No

in sql table following column r there i want find 1st paid ,2nd paid,3rd paid date for same |servi..

Answer / ajit nayak

select distinct vehicle_no, wm_concat( date )
from vehicle_service
group by vehicle_no;

Is This Answer Correct ?    0 Yes 0 No

in sql table following column r there i want find 1st paid ,2nd paid,3rd paid date for same |servi..

Answer / 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

More SQL PLSQL Interview Questions

what are the system privileges that are required by a schema owner (user) to create a trigger on a table?

0 Answers  


what is csv? : Sql dba

0 Answers  


How much ram can sql express use?

0 Answers  


What are different categories of sql commands?

0 Answers  


Show the cursor attributes of pl/sql.

0 Answers  


How do you update a value in sql?

0 Answers  


What is meant by user defined function?

0 Answers  


What are wait events. Describe the wait event tables.

1 Answers   CTS,


how to create a table index in mysql? : Sql dba

0 Answers  


i have table T!. A B C D NULL 1 2 3 4 NULL 5 6 7 8 NULL 9 10 11 12 NULL. I WANT COUNT OF NULL VALUES IN TABLE. WRITE A QUERY.

14 Answers   iGate, Wipro,


What is the relation b/w view and trigger

3 Answers   Accenture, TCS,


Please let me know if UNION ALL and Natural Join does the same operation and are same...

7 Answers   iGate,


Categories