Update using Case Statement

  • Hi,

    From the attached 4 Tables Schema Diagram

    Will the below query Reduce me the ListPrice by 20% if i didn't receive the order for the last 2 years ? Jammed 🙁

    SELECT Name,ProductNumber,StandardCost,

    ListPrice

    = CASE

    WHEN _________ THEN (ListPrice / 1.20 )

    END

    FROM product

    JOIN SalesOrderDetail

    ON product.ProductID = SalesOrderDetail.ProductID

    Help me with some alternative to the above friends.

    Regards,

    Vijay

  • nexus2vijay (11/12/2015)


    Hi,

    From the attached 4 Tables Schema Diagram

    Will the below query Reduce me the ListPrice by 20% if i didn't receive the order for the last 2 years ? Jammed 🙁

    SELECT Name,ProductNumber,StandardCost,

    ListPrice

    = CASE

    WHEN _________ THEN (ListPrice / 1.20 )

    END

    FROM product

    JOIN SalesOrderDetail

    ON product.ProductID = SalesOrderDetail.ProductID

    Help me with some alternative to the above friends.

    Regards,

    Vijay

    In keeping with the effort you are putting into your questions, I will give you the answer. "No it won't".

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • nexus2vijay (11/12/2015)


    Hi,

    From the attached 4 Tables Schema Diagram

    Will the below query Reduce me the ListPrice by 20% if i didn't receive the order for the last 2 years ? Jammed 🙁

    SELECT Name,ProductNumber,StandardCost,

    ListPrice

    = CASE

    WHEN _________ THEN (ListPrice / 1.20 )

    END

    FROM product

    JOIN SalesOrderDetail

    ON product.ProductID = SalesOrderDetail.ProductID

    Help me with some alternative to the above friends.

    Regards,

    Vijay

    if you insist on continuing to post new questions and neglect to respond to all the other questions you have posted today......I am not sure that you are going to get the support that you desire.

    please respond to some of your other posts...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • Phil Parkin (11/12/2015)


    nexus2vijay (11/12/2015)


    Hi,

    From the attached 4 Tables Schema Diagram

    Will the below query Reduce me the ListPrice by 20% if i didn't receive the order for the last 2 years ? Jammed 🙁

    SELECT Name,ProductNumber,StandardCost,

    ListPrice

    = CASE

    WHEN _________ THEN (ListPrice / 1.20 )

    END

    FROM product

    JOIN SalesOrderDetail

    ON product.ProductID = SalesOrderDetail.ProductID

    Help me with some alternative to the above friends.

    Regards,

    Vijay

    In keeping with the effort you are putting into your questions, I will give you the answer. "No it won't".

    Your calculation is wrong and you're use of the the CASE statement is incomplete.

    Considering Phil's answer, I'll let you find the errors on your own.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Thanks for the revert Bossman.

    I'm not a Techie infact. I'm from Teaching field and new to IT industry and getting to know the DB.

    If you could help me out help me. Else don't just discourage on other parts as i have already got my other 3 queries posted. Since i'm hooked up here at this 4th one. Seeking some suggestions else thanks for your tremendous support.

    Cheers,

    Vijay

  • nexus2vijay (11/12/2015)


    Thanks for the revert Bossman.

    I'm not a Techie infact. I'm from Teaching field and new to IT industry and getting to know the DB.

    If you could help me out help me. Else don't just discourage on other parts as i have already got my other 3 queries posted. Since i'm hooked up here at this 4th one. Seeking some suggestions else thanks for your tremendous support.

    Cheers,

    Vijay

    You are joking, I hope.

    While in your 'teaching field', do you suggest to your pupils that the road to their success is to ask others to do their work for them, rather than their sitting down with a book and learning for themselves?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • nexus2vijay (11/12/2015)


    Thanks for the revert Bossman.

    I'm not a Techie infact. I'm from Teaching field and new to IT industry and getting to know the DB.

    If you could help me out help me. Else don't just discourage on other parts as i have already got my other 3 queries posted. Since i'm hooked up here at this 4th one. Seeking some suggestions else thanks for your tremendous support.

    Cheers,

    Vijay

    not sure who "Bossman" is....???

    anyways...here a link to very useful set of instructions that will help you post some sample tables/data/expected results.....if you can provide such data, then I think you will be pleasantly surprised on the detail and quality of the answers you get to help you solve your problems.

    http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/

    best wishes

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 7 posts - 1 through 6 (of 6 total)

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