Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select statement query... !

naveenvishal
Contributor
0 Likes
678

im giving the select stmt as:

select ..... where name like 'D%'.

i want to eleminate caps lock defferentaion, so that all records with 'D' or with 'd' will be selected.

i want to include that in SINGLE LIKE only, not like this:

select ..... where name like 'D%' or name like 'd%'.

-


Kindly suggest if can b achieved.

Thanx,

Naveen VIshal

1 ACCEPTED SOLUTION
Read only

naveenvishal
Contributor
0 Likes
653

yaar, what about the capital letter avoidance condtion..i need both 'D' as well as 'd'..

Thanx,

Naveen VIshal

6 REPLIES 6
Read only

naimesh_patel
Active Contributor
0 Likes
653

Yes it could be achieved as you have decided.

select ..... where name like 'D%' or name like 'd%'.

Like:


DATA: l_maktx TYPE maktx.

SELECT SINGLE maktx
 INTO l_maktx
 FROM makt
 WHERE ( maktx LIKE 'D%'
 OR maktx LIKE 'd%' ).

Regards,

Naimesh Patel

Message was edited by:

Naimesh Patel

Read only

Former Member
0 Likes
653

Hi Naveen,

I think If you keep 'D%' in your where clause it will consider both 'D%' & 'd%', need not to specify seperately.

Regards,

Satish

Read only

naveenvishal
Contributor
0 Likes
653

can anything like this can be done, as in the case of Contains Pattern (CP) it is done like '#D#%'.

can u suggest for the single like stmt.

Read only

0 Likes
653

You can do it like this:

Where Field1 like '%D%'

But it will bring on the data where Field1 contains the D.. no matter in which place weather 1st or 4th or lat.

Regards,

Naimesh Patel

Read only

naveenvishal
Contributor
0 Likes
654

yaar, what about the capital letter avoidance condtion..i need both 'D' as well as 'd'..

Thanx,

Naveen VIshal

Read only

0 Likes
653

For D and d you have to use it like this:

Where ( Field1 like '%D%' or field1 like '%d' ).

Regards,

Naimesh Patel