Single Row Function

Display details of employees having same char at the star and end postition of their name

like

abishika

this name have last character and first character is same

Questions by sunil_bisht   answers by sunil_bisht

Showing Answers 1 - 24 of 24 Answers

kgoyal15

  • Feb 12th, 2009
 

SELECT     *
FROM         table_users
WHERE     (LEFT(name, 1) = SUBSTRING(name, LEN(name), LEN(name)))

  Was this answer useful?  Yes


select * from hz_parties
where ascii(substr(party_name,1,1))= ascii(substr(party_name,-1,1))

This works in Toad 10g dint try in sql plus

thanks
neo

  Was this answer useful?  Yes

This can be accomplished in two ways example

CREATE TABLE emp (n number,
name varchar2(30),
sal number)

INSERT into emp values (100,'abhisheka',10000)
INSERT into emp values (101,'noabhisheka',10000)

Method 1:
SELECT *
FROM emp
WHERE substr(name,1,1)=substr(name,length(name))

Method 2:
SELECT *
FROM emp
WHERE substr(name,1,1)=substr(name,-1,1)

  Was this answer useful?  Yes

Following query produces the desire results


select last_name from employees where select last_name from employees where substr(lower(last_name),1,1)=substr(lower(last_name),-1,1)

  Was this answer useful?  Yes

select * FROM emp Where upper(substr(NAME,1,1)) = upper(substr(NAME,-1,1));

i tried this and is working...


mistake in the previous answers is comma (,) is not used instead space(' ') is used.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions