• pk (unregistered)

    Bah, this is simply a case of formatting. Here, let me fix that for you.

    AND CASE WHEN @c_usergroup = 50 AND NOT EXISTS( SELECT 1 FROM l_appl_client lac WHERE lac.f_application = fa.f_application AND lac.c_linktype = 840 AND lac.stat = 0 AND CASE WHEN ISNULL(lac.f_client,0) <> @f_client_user AND ISNULL(lac.f_c_f_client,0) <> @f_client_user THEN 0 ELSE 1 END = 1 ) THEN 0 ELSE 1 END = 1 -- 07.09.2022

    See? Now it's clear as day. (/jk, I still have no idea what's going on)

  • (nodebb)

    It certainly makes me want to change the c_c_c_channel.

    It could be worse... Imagine a prefix "ch_" and a column for, well, for changes.

    ch_ch_ch_changes

    (Sorry)

    Addendum 2026-03-05 09:22: I'd also like to offer my apologies to David Bowie if he's watching us from "up there"...

  • Scott (unregistered)

    I always check closely at the code snippets to see if someone inherited code from somewhere I used to work. I don't have to worry about Python, PHP, or C/C++ but TSQL like this makes me nervous until I verify it's not something that can be traced back to me.

  • GlowerBuilder (unregistered)

    I spent the last five years working on a PowerBuilder application where all the business logic was in a massive database. Never. Again.

  • Jason Stringify (unregistered)

    "Qaudruple"?

  • (nodebb) in reply to Steve_The_Cynic

    GOing back further in time, there's k_k_k_Katie.

  • BTO (unregistered)

    You think this is bad? B_b_b_baby, you ain't seen n_n_n_nothing yet.

  • COBOL Dilettante (unregistered)

    I'd never considered doing WHERE (CASE WHEN some condition THEN 1 ELSE 0 END) = 1 before. It looks so much cleverer than WHERE some condition !

  • mihi (unregistered)

    A weird reason why I am guilty of using constructs like WHERE (CASE WHEN complex_condition THEN 'Y' ELSE 'N' END) = 'N': In older Oracle versions, it was not possible to create a function-based index on a boolean function (to be honest I am not sure if it is possible in recent versions either), but that CASE statement was not boolean so you could index it and get a nice and fast INDEX RANGE SCAN.

  • (nodebb)

    And here we see the risk; the sense of @COBOL Dilettante's WHERE and @mihi's WHERE are opposite. Niggling details matter.

Leave a comment on “Qaudruple Negative”

Log In or post as a guest

Replying to comment #692606:

« Return to Article