Select with a preffered where condition, but if missing use another
0
votes
1
answer
53
views
I have the following select in SAP HANA DB:
SELECT name, text, lang FROM texts
WHERE name IN ('name1', 'name2', 'name2')
AND lang IN ( 'S', 'E' )
INTO TABLE @DATA(lt_texts).
It will select multiple lines for a given name if translations exist for different languages.
How do I say that I want texts with language = 'S', but if it doesn't exist, then select ones with lang = 'E'. I want it in a single request to the DB and no processing on application level.
Thank you in advance
Asked by kdobrev
(101 rep)
Sep 30, 2019, 04:20 PM
Last activity: Sep 30, 2019, 05:24 PM
Last activity: Sep 30, 2019, 05:24 PM