Need Help: On Query with Case Statement

  • windows_mss


    Points: 2423


    As part of development task I have to write a SQL logic for the below 6 scenarios, I have achieved desired result in my query using Case Statement but I want to know is there any other options(ways) where I can write query without using Case Statements to achieve the same result using sub-query or window function?

    Table 1 - This table will have User Account Type & Subscription Amount

    Table 2 - This table will have User Information.

    2019-10-13 00_00_27-Book1 - Excel

    Note: I'm not is allowed to share my script from this computer. Sorry for that.

    • This topic was modified 8 months, 3 weeks ago by  windows_mss.
    You must be logged in to view attached files.

    Known Is An Drop,Unknown Is An Ocean....
    Njoy Programming

  • Site Owners

    SSC Guru

    Points: 80376

    Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • John Mitchell-245523

    SSC Guru

    Points: 148761

    Why do you want to avoid using a case expression?  Why are you not allowed to share the script?

    Seriously, if you're asking for help with what appears to be a homework question with no DDL, sample data or expected results, and you can't show us what you've already tried, then I think you're going to draw a blank.


  • michael.cole 47030

    Right there with Babe

    Points: 731

    I have come up with the perfect solution for you.  It is really quick, and doesn't use case statements, and does everything you want.

    Unfortunately, I am not allowed to share that script from this computer. Sorry for that.

    But trust me, its really good.


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply