Skip to content
Advertisement

Tag: case

IS NULL in CASE in predicates

tell me pls, that’s real – use the CASE construct, where the expression with IS NULL/IS NOT NULL will be returned in TNEN? I have a procedure in a package that receives an input parameter and it is …

Cannot figure out the issue with this SQL CASE

The issue i am facing is: “SYNTAX_ERROR: line 7:6: All CASE results must be the same type: boolean” I have also joined the table in a previous sub query casting it as a varchar, so there shouldn’t be any issues with this. Anyone have any ideas? For context i am trying to populate a field that would return a blank

sql nested “sum (case when) or” select query

I have a select query where I am trying to sum a value based on multiple criteria, grouped by dimension. The output will be the sum of the time greater than 30, 90, or 365 days based on the category, grouped by category. I can’t crack the syntax for this, I hope you can help! The concept looks something like

Deducting values from 2 case statements from one another

I have two CASE statements and I’m trying to deduct the value of one from another, but I can’t get the code to work. Does anyone have any suggestions where I’m going wrong? The 2 CASE statements are: and When I try to combine these I get errors (missing right parenthesis). The combined code is: as “CALENDAR DAYS”, Answer Forpas

Conditionally joining from multiple tables

Does SQL allow some form of conditional “table choosing” within the Join statement? ie. selecting a different table to join based on a predefined variable/condition. The error I get when attempting this method is ORA-00905: missing keyword. Answer No. Neither SQL nor Oracle allow this, unless you use dynamic SQL. Assuming the tables have the same columns, you could write

Advertisement