06-05-2022 10:02 PM
Hi,
I am going through some of SAP tutorials and found the following:
SELECT * FROM SPFLI WHERE CITYFROM LIKE '_R%'.
WRITE: /10 SPFLI-CARRID, 20 SPFLI-CONNID,
30 SPFLI-CITYFROM.
ENDSELECT.
following is my resulting list which doesnot include SINGAPORE.. Can someone explain why?
Thanks
JP
06-06-2022 6:53 AM
Hi,
I tried the below query it's working. if you write underscore before R then it will consider you are looking for the word with the second character as R and if you write %R% then it will look for the word with R character.
SELECT * FROM SPFLI WHERE CITYFROM LIKE '%R%'.
WRITE: /10 SPFLI-CARRID, 20 SPFLI-CONNID,
30 SPFLI-CITYFROM.
ENDSELECT.
I hope this helpful.
Regards,
Anuja Kawadiwale
06-06-2022 7:03 AM
Hi
As per your where clause
WHERE CITYFROM LIKE '_r%'
--Finds ALL values that have "R" in the second position of the string.
06-07-2022 9:29 AM
Review your course materials, % represents 0, 1 or multiple characters, _ represent a single character.
Can you guess your mistake?