Link to home
Start Free TrialLog in
Avatar of sam2929
sam2929

asked on

filter only by one character

Hi ,
I have data as below

mary
john simpson
L
P
KAMRA

I want result like

L
P

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Member_2_2484401
Member_2_2484401
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm not really clear. What, exactly, are you trying to accomplish?
For all columns with only one character -
select column from yourtable where length(column) = 1
For all columns starting with 'L' or 'P' -
select column from yourtable where substr(column,1,1) in ('L','P')
For all columns where the column value is 'L' or 'P'
select column from yourtable where length(column) = 1 and column in ('L','P')
If you're only looking for one-character values in your column, then the trim function is unnecessary.