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
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 |
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 |
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 |
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 |
what is unique key constraint? : Sql dba
what is self join and why is it required? : Sql dba
hi,i plan to put experience on PLSQL ,can anyone suggest me for any institutes in bangalore or how to prepare for interviews
How do I run a sql trace?
What is dml with example?
What is Primary Key?
how to enter characters as hex numbers? : Sql dba
what is 'mysqldump'? : Sql dba
Why we use join in sql?
Why do we need sharding?
What is a constraint. Types of constraints ?
5 Answers Accenture, BirlaSoft,
What is consistency?