UPDATE PART OF DATA

  • I HAVE A TABLE WITH THREE FIELD

    COMCOD SIRCODE SIRDESC

    3305 180001 KARIM ENTERPRISE

    3305 180002 RAHIM ENTERPRISE

    3305 180003 JASON G STORE

    DATE TYPES COMCOD nchar(4), SIRCODE nvarchar(6) PRIMARY KEY, SERDESC nvarchar(250).

    I LIKE TO UPDATE ONLY SIRCODES TO START WITH 19 WHERE SIRCODE FROM THE LEFT STARTED WITH 18 THAT IS NEW TABLE WILL LOOK LIKE

    COMCOD SIRCODE SIRDESC

    3305 190001 KARIM ENTERPRISE

    3305 190002 RAHIM ENTERPRISE

    3305 190003 JASON G STORE

  • SELECT

    COMCOD

    ,STUFF(SIRCODE,1,2,'19') AS SIRCODE

    ,SIRDESC

    FROM

    [YourTable]

    WHERE

    LEFT(SIRCODE,2) = '18'

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

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