• Re: [Info-ingres] add leading zero in sql

    From nikosv@nikos.vaggalis@gmail.com to comp.databases.ingres on Mon Apr 26 03:16:03 2021
    From Newsgroup: comp.databases.ingres

    1> select * from orditems



    roiroCroCroCroCroCroCroCroCroCroCro4roCroCroCroCroCroCroE roeorder_numbroeitem_nroe roLroCroCroCroCroCroCroCroCroCroCro+roCroCroCroCroCroCron
    roe123456 roe22 roe
    roe123456 roe2 roe rooroCroCroCroCroCroCroCroCroCroCro|roCroCroCroCroCroCroy
    (2 rows)
    2> select
    case length(item_number) when 1 then
    order_number+'0'+item_number
    else
    order_number+item_number
    end orderwithitem
    from orditems


    roiroCroCroCroCroCroCroCroCroCroCroCroCroCroE
    roeorderwithitemroe
    roLroCroCroCroCroCroCroCroCroCroCroCroCroCron
    roe12345622 roe
    roe12345602 roe
    rooroCroCroCroCroCroCroCroCroCroCroCroCroCroy
    (2 rows)
    End of Request--- Synchronet 3.21b-Linux NewsLink 1.2