This topic contains 2 replies, has 0 voices, and was last updated by rpmartin 16 years, 3 months ago.

  • Author
    Posts
  • #8327

    rpmartin

    I’m trying to get to several prices held in the item_prices table. I can get results from the table in the following form:

    Item_ID Item_Unit_Price Name

    164262 37.5 List Price

    164262 24.75 Sale Price

    164262 24.75 Trade Price

    But I would like to get them in the form

    Item_ID List_Price Sale_Price Trade_Price

    164262 37.5 24.75 24.75

    Is there a way to do this in a SQL query or is this something I’ll need to export to Excel and work with there?

    Thanks in advance for your help,

    Rob
    This is a cached copy. Click here to see the original post.

  • #8328

    evan_goldberg

    RE: Working with Item Prices

    well, it’s not pretty but

    select item_id, max(decode(Name,’List Price’, Item_Unit_Price)) “List Price”,

    max(decode(Name,’Sale Price’, Item_Unit_Price)) “Sale Price”,

    max(decode(Name,’Trade Price’, Item_Unit_Price)) “Trade Price”

    from item_prices

    group by item_id

    Thanks,

    -e

  • #8329

    rpmartin

    RE: Working with Item Prices

    It seems to be working fine. Thanks Evan!

You must be logged in to reply to this topic.