Skip to content
Advertisement

Tag: oracle12c

How to tokenize semicolon separated column value to pass to IF statement in a function in Oracle DB

I have a table called ‘config’ and when I query it in following manner: SELECT value FROM config WHERE property = ‘SPECIAL_STORE_ID’ its response will be: 59216;131205;76707;167206 //… (1) I want to tokenize the above values using semicolon as the delimiter and then use them in a user-defined Function’s IF statement to compare, something like this: where in_store_id is the

Combining MAX and SUM in an Oracle ROLLUP

Here’s my SQL: The output looks like this: I was expecting it to look like this: In other words, I was expecting the rollup to sum up the maximum weights of each food instead of taking the maximum of all the maximums in the food-type category. I do have a solution of sorts, but it means having to add an

Advertisement