Need Help: On Query with Case Statement

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

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

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

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

  • 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

  • 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 3 (of 3 total)

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