Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    3

    Question Unanswered: How to get the last number of an integer number?

    I have a table named T_INFO, and there is a column named CODE whose type is INTEGER. Now I wanna get the last number of every value of this column. I try to use left(cast(CODE as char(10)),1),but as the length of the number is not a fixed number,so using char(10) may not get exact string I want. How should I write the sql? Thank you
    Last edited by somn; 11-20-06 at 13:28.

  2. #2
    Join Date
    Aug 2004
    Posts
    3
    I thought too much about this,what I should do is just mod(code,10)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •