Another SQL Question -- Please Reply

  • how do I change "Pack of" to "Case of" in the following ?

    SELECT     NAME

    FROM         dbo.PRODUCT

    WHERE     (NAME LIKE '%pack of%')

    ------------------------------------------

    Current Results

    Beer (Pack of 12)

    Gold Shoes (Pack of 12)

    Hamburger (Pack of 12)

    IceCream (Pack of 12)

    ------------------------------------------

    Desired Results

    Beer (Case of 12)

    Gold Shoes (Case of 12)

    Hamburger (Case of 12)

    IceCream (Case of 12)

    ------------------------------------------

    Options

    1. SELECT REPLACE('abcdefghicde','cde','xxx')

    2. Delete Pack, and then readd --> how can you delete part of a field ?

  • select replace(name, 'Pack of', 'Case of')

    FROM         dbo.PRODUCT

    WHERE     (NAME LIKE '%pack of%')


    Cheers,
    - Mark

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

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