Application Development 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: 

select comma seperated field value with range table comparision

dhanudjro
Participant
0 Kudos

Hi ,

Im trying to pull data from a custom table for a particular field in which values are saved in comma separated

as MM,SD,Date,Time. My input(Parameter) will also be in comma separated like Date,FI,PP. In this case as Date is matching with the saved field value that record should be fetched. Is there any way that we can achieve this in the SELECT(SQL) statement. I can process this in a loop, but looking for SQL solution if any.

3 REPLIES 3

BUTZ
Explorer
0 Kudos

Dear DhanunjayaRao,

I use the LIKE Statement for fields which contains multiple Information:

SELECT SINGLE * FROM dbtab INTO wa

WHERE DBfield LIKE '%123%'.

If DBfield contain ' xyz; 123; ABC' it will be found.

Regards Oliver

matt
Active Contributor
0 Kudos

Why is your data held in the custom table in such an awkward way? Perhaps you should fix that?

Sandra_Rossi
Active Contributor
0 Kudos

I guess that you want to get rid of this column and convert it into a normal table.

You say "SQL"; do you mean Native SQL (Oracle, HANA, etc.) or Open/ABAP SQL? In the latter case, I don't think you can do it unless you create a SQL procedure.