PDA

View Full Version : Selecting portion of a data from a field? Help...


binici
05-04-2006, 06:24 PM
Hello, this might be a silly question, but what would be the function to select lets say only about 40 characters within a varchar data field?

example that data field may contain about 500 characters, but i only want to select to first 20 characters to output.

Thank you,

BiNiCi

mio
05-04-2006, 08:32 PM
hi,

try:

select substring(your_field, int begin_pos, int end_pos) from your table where your clause

int begin_pos : an integer value for the initial value of the cursor
int end_pos : need explanation ?;)
result is your_field trim between the begin_pos and end_pos interval.