none
(Sumber: milis SQL Server) Memisahkan angka dengan huruf RRS feed

  • Pertanyaan

  • Dear para master,

    Minta bantuan ada case seperti dibawah. Ini ada field kolom yg isinya notelp gabung sama nama.

    0812345678joko susilo

    7654321ahmad

    Saya ingin memisahkan no telp dan nama menjadi masing2 kolom sendiri.


    Best Regards,
    Agnes Sannie [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Jumat, 26 April 2013 07.58
    Moderator

Jawaban

  • select 

    left('column',patindex('%[a-z]%','column')-1) as no_telp, 

    right('column',len('column')-patindex('%[a-z]%','column')+1) as nama

    cth.

    select 

    left('123456Abcd',patindex('%[a-z]%','123456Abcd')-1) as no_telp, 

    right('123456Abcd',len('123456Abcd')-patindex('%[a-z]%','123456Abcd')+1) as nama

    Dijawab oleh: Gempur


    Best Regards,
    Agnes Sannie [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Jumat, 26 April 2013 07.58
    Moderator