Need Help: On Query with Case Statement

  • windows_mss

    SSCrazy

    Points: 2423

    Hi,

    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 1 month, 1 week ago by  windows_mss.
    Attachments:
    You must be logged in to view attached files.

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

  • Site Owners

    SSC Guru

    Points: 80380

    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: 148375

    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.

    John

  • michael.cole 47030

    Say Hey Kid

    Points: 687

    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