回覆列表
  • 1 # 何以笙丶丶

    用 substr

    比如:substr(colname,1,length(colname) - 3)

    oracle的substr函式的用法

    取得字串中指定起始位置和長度的字串 substr( string, start_position, [ length ] )

    如:

    substr("This is a test", 6, 2) would return "is"

    substr("This is a test", 6) would return "is a test"

    substr("TechOnTheNet", -3, 3) would return "Net"

    substr("TechOnTheNet", -6, 3) would return "The"

    select substr("Thisisatest", -4, 2) value from dual 結果是 te

    select substr("emros",-3,1) value from dual 結果是 r

    substr("abcde",-6) = null

    substr("abcde",-5) = "abcde"

    substr("abcde",-4) = "bcde"

    substr("abcde",-3) = "cde"

    substr("abcde",-2) = "de"

    substr("abcde",-1) = "e"

    substr("abcde",-0) = "abcde"

  • 中秋節和大豐收的關聯?
  • 備孕期間可以用化妝品嗎?對胎兒有什麼影響?