View previous topic :: View next topic
|
Author |
Message |
teji4
New User
Joined: 26 Oct 2007 Posts: 9 Location: bangalore
|
|
|
|
How to retrive first 3 digits from the table?
The data declard decimal(10,0)
How to write SQL query? |
|
Back to top |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
You can try this.
Code: |
SUBSTR(DIGITS(COL1),1,3) |
|
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Srihari,
Did you execute this? I am getting invalid error. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
ksk,
well if it is an INVALID ERROR it must be ok.
probably refered to your typing, unless you have a really old vsn of db2.
anyway, Srihari's syntax is ok. |
|
Back to top |
|
|
|