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 pl/sql table? Why is it used?
What is group by in sql?
How can you tell the difference between an index and a view?
What are the types of optimization?
Can variables be used in sql statements?
explain commit and rollback in mysql : sql dba
Is sql database free?
how to get @@error and @@rowcount at the same time? : Sql dba
what are rollup and cube in t-sql? : Transact sql
What are character functions in sql?
What does partition by mean in sql?
What is data profiling in sql?
What are all the different normalizations?
i have a column which may contain this kind of value: 123*67_80,12*8889_5,34*8_874 ,12*7_7 (can contain space before a comma, and this string length can be anything) now i want to split this value into two column like: column1: 123*67,12*8889,34*8,12*7 column2: 80,5,874,7 use function for this
What are sql built in functions?