display value from a column in table in two separate columns

  • i have a value say 11 in one of my columns i need to compute and break it in two separate columns A and B like 6 and 5

     

    Attachments:
    You must be logged in to view attached files.
  • Like this?

    DROP TABLE IF EXISTS #t1;

    CREATE TABLE #t1
    (
    c1 INT
    );

    INSERT #t1
    (
    c1
    )
    VALUES
    (2 )
    ,(11)
    ,(4)
    ,(9);

    SELECT t.c1
    ,c2 = t.c1 / 2
    ,c3 = t.c1 - t.c1 / 2
    FROM #t1 t;

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

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

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