View previous topic :: View next topic |
Author |
Message |
radkrish Beginner

Joined: 12 Aug 2005 Posts: 102 Topics: 19
|
Posted: Tue May 08, 2007 12:16 pm Post subject: fetch only spaces in between fields |
|
|
My requirement is to fetch only records which have spaces in between the field value.
Eg.,
Code: |
Sub-num
35 8459
A24 809
4546657
2534675
356 890
|
result should be : Code: |
35 8459
A24 809
356 890
|
Can anyone help me to write the above logic using DB2.
regds,
radkrish |
|
Back to top |
|
 |
CraigG Intermediate
Joined: 02 May 2007 Posts: 202 Topics: 0 Location: Viginia, USA
|
Posted: Tue May 08, 2007 12:36 pm Post subject: |
|
|
Assuming DB2 try this
Code: |
select * from table
WHERE POSSTR(STRIP(SUB_NUM), ' ') <> 0;
|
|
|
Back to top |
|
 |
radkrish Beginner

Joined: 12 Aug 2005 Posts: 102 Topics: 19
|
Posted: Tue May 08, 2007 2:06 pm Post subject: |
|
|
Thanks, Craig.
regds,
radkrish |
|
Back to top |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Wed May 09, 2007 12:08 am Post subject: |
|
|
You can try this.
Code: | SELECT SUB_NUM FROM TABLE
WHERE SUB_NUM LIKE '% %'; |
|
|
Back to top |
|
 |
|
|