View previous topic :: View next topic
|
Author |
Message |
sambasivarao
New User
Joined: 10 Jul 2006 Posts: 47 Location: Bangalore
|
|
|
|
I have a table called NAME. In that table there is one field called FIRSTNAME. I want to retrieve the first name(field) which is has a single character ONLY.
Cheers,
Samba. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
This should get you closer:
Code: |
SELECT *
FROM NAME
WHERE LENGTH(RTRIM(FIRSTNAME)) = 1 |
Dave |
|
Back to top |
|
|
sambasivarao
New User
Joined: 10 Jul 2006 Posts: 47 Location: Bangalore
|
|
|
|
Thanks a lot David for quick response.
Cheers,
Samba. |
|
Back to top |
|
|
sambasivarao
New User
Joined: 10 Jul 2006 Posts: 47 Location: Bangalore
|
|
|
|
Hi David,
Apart for this, any other options are there to get the single character of the field.
Thanks a lot in advance for your help.
Cheers,
Samba. |
|
Back to top |
|
|
vijju123
New User
Joined: 13 Dec 2006 Posts: 2 Location: delhi
|
|
|
|
Hai david...thanks for the answer ..would you please elaborate the query..that is..
WHERE LENGTH(RTRIM(FIRSTNAME)) = 1
what does RTRIM? STANDS FOR...
thanks in advance
cheers,
vijju. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Hi vijju123,
It stands for Right TRIM. It trims, or removes blanks from the Right Side of the value, changing the length also.
Here's the link to the Manual
RTRIM |
|
Back to top |
|
|
|