Forum Replies Created

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

  • RE: T-SQL: Why “It Depends”

    In the past I have used this technique to find the "latest" record for each Product:

    SELECT a.Product, a.SaleQuantity, a.SalePrice, a.SaleDate, a.SaleComments

    FROM dbo.SalesDetail a

    WHERE NOT EXISTS (

    SELECT 1 FROM dbo.SalesDetail...

  • RE: Stored procedure to Update the table

    [font="Courier New"]CREATE PROCEDURE [proc_update_table] @key_value [int], @column_value [varchar](50)

    AS

    UPDATE table_name

    SET column_in_question = @column_value

    WHERE ID = @key_value[/font]

    job done...

  • RE: Processing Comma Separated Lists

    Hi Jeff

    Your solution using the "Tally" and derived position tables worked beautifully...

    I got exactly what I needed.

    That was some mighty fine codin' Mr. Moden.

    Your assistance is greatly appreciated.

    Cheers

    Evan

  • RE: Processing Comma Separated Lists

    It's a moot point because the item value without a positional modifier is meaningless.

    As a purely academic exercise to answer you question:

    SELECT code_list_id FROM code_list

    WHERE (code_1 = 'Charlie' )...

  • RE: Processing Comma Separated Lists

    Kind of....

    If "Charlie" is put into Code_2, then that code line is not returned when you search for records with "Charlie" in Code_3. That is a perfectly valid situation.

  • RE: Processing Comma Separated Lists

    Sergiy

    Yes. The black-box machine that spits out the code lists always produces between 2 and 5 items in a code_list_text value. They are always "stuffed left". There are never blank...

  • RE: Processing Comma Separated Lists

    Hi Jeff

    Old habits die hard and the fingers get ahead of the brain. I meant to type "T-SQL" of course...

    Thanks

    Evan

  • RE: Processing Comma Separated Lists

    Segiy

    You are correct in some ways. However the typical query is more along the lines of :

    select the code_list_ids that have 'Bravo' as the second code item and 'Alpha' as...

  • RE: Processing Comma Separated Lists

    Sergiy

    5 Codes to a list is a hard limit imposed in the legacy system. It won't be added to as I don't think anyone knows how any more...

    I don't want...

  • RE: Records with lower case in DB

    Try using single quotes

    select column + ' some text ' as result

    from MyTab

    Is column defined as a char or varchar? If not you may need to convert to a character...

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