Home > database >  Consult the oracle to satisfy a certain condition is in front of the recording method
Consult the oracle to satisfy a certain condition is in front of the recording method

Time:09-29

now want to extract the empty before the data is good, don't blank lines after the data, could you tell me how to get to?

CodePudding user response:

CodePudding user response:

As with m (
Select t. *, row_number () over (order by col1) rn from mytable
)

Select a t1. * from m t1 inner join t2 on t1. Rn=t2. Rn + 1
Where t2. Col2 is null

CodePudding user response:

refer to the second floor wmxcn2000 response:
with m as (
Select t. *, row_number () over (order by col1) rn from mytable
)

Select a t1. * from m t1 inner join t2 on t1. Rn=t2. Rn + 1
Where t2. Col2 is null
thank moderator

CodePudding user response:

refer to the second floor wmxcn2000 response:
with m as (
Select t. *, row_number () over (order by col1) rn from mytable
)

Select a t1. * from m t1 inner join t2 on t1. Rn=t2. Rn + 1
Where t2. Col2 is null

Yes, praise a!
  • Related