如何替换列值

时间:2016-04-11 13:22:17

标签: sql oracle plsql

我需要将所有信用卡的最后10个号码更改为**********

例如496011111111114960**********

请帮忙

4 个答案:

答案 0 :(得分:1)

即使信用卡中的位数未知或不同且最多包含19位数,也可以使用此功能。根据标准卡号,最多应有19位ES7

<强>查询:

card_number
  

PS - 在案例卡中包含Florin Ghita的更新已超过20位。   学分: select substr('01234567890123456789',1,length('01234567890123456789')-10) || '**********' from dual; ---Output `0123456789**********` with Credit_Card_details AS ( select '1234567890123456789' as CARD_NUMBER from dual ) select CARD_NUMBER AS String, length(CARD_NUMBER) AS string_length, REPLACE(CARD_NUMBER,substr(CARD_NUMBER,length(CARD_NUMBER)-10+1),'**********') AS New_string, length(REPLACE(CARD_NUMBER,substr(CARD_NUMBER,length(CARD_NUMBER)-10+1),'**********')) AS New_string_length from Credit_Card_details

{{1}}

Reference WIKI

答案 1 :(得分:0)

试试这个:

Select Substr(cardnumber, 1, 4)||'**********' from 
  yourcardtable;

答案 2 :(得分:0)

update table1 set credit_number = rpad(substr(credit_number, 1, 4), length(credit_number), '*');

答案 3 :(得分:-1)

尝试此查询:

jquery.ajaxSetup({
    dataFilter: function (data, type) {
        //modify the data

        return data;
    }
});