|
|
Archives of the TeradataForum
Message Posted: Fri, 08 Dec 2006 @ 11:29:40 GMT
Subj: | | Re: Nth digit in a DECIMAL(10,0) |
|
From: | | Redekar, Rahul |
Hi Prahlad,
Check whether the example given below can help you.
ct test (col1 dec(10,0));
*** Table has been created.
*** Total elapsed time was 1 second.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
insert into test values(1159283);
*** Insert completed. One row added.
*** Total elapsed time was 1 second.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
insert into test values(1155283987);
*** Insert completed. One row added.
*** Total elapsed time was 1 second.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
insert into test values(152639877);
*** Insert completed. One row added.
*** Total elapsed time was 1 second.
BTEQ -- Enter your DBC/SQL request or BTEQ command:
sel cast(((cast(col1 as char(4)))mod 10) as char(1)) from test;
*** Query completed. 3 rows found. One column returned.
*** Total elapsed time was 1 second.
(col1 MOD 10)
-------------
6
9
5
Regards,
Rahul Redekar.
| |