Results 1 to 5 of 5

Thread: Can I get 1st and last letter of emp name same time

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Geek_Guest
    Guest

    Can I get 1st and last letter of emp name same time

    Actually I am having a emp table, I need name, Can I get 1st and last letter same time? How to get? Pls tell me the ans? When we will get mutating error?

    Question asked by visitor ramesh


  2. #2
    Contributing Member
    Join Date
    May 2007
    Answers
    32

    Re: Can I get 1st and last letter of emp name same time

    hi

    you can get the first and last letter same time in a single column.
    i will give one query u go through it


    select to_char(substr(QWF_WARRANTY_TYPE_CD,0,1)||substr(QWF_WARRANTY_TYPE_CD,8,9)) from qa_warranty_fir
    where QWF_FIR_JOBCARD_ID=1017


    by using this we can get the first and last name in a single column.

    if wrong pls reply me.


  3. #3
    Junior Member
    Join Date
    May 2007
    Answers
    1

    Re: Can I get 1st and last letter of emp name same time

    Select substr(ename,1,1)||substr(ename,-1,1) name from emp;


  4. #4
    Junior Member
    Join Date
    Jul 2006
    Answers
    4

    Re: Can I get 1st and last letter of emp name same time

    Hi

    u can get the first and last letter from a column by using :
    Select substr(,1,1)||substr(,length(),1) from

    Mutating tAble Error will come mainly in the TRiggers /
    When ever the Table data is manipulating is not yet commited ( like update / delete/ insert) , at the same time if u are trying to access the table data
    then you will get the Mutating table error.


  5. #5
    Contributing Member
    Join Date
    Jan 2007
    Answers
    33

    Re: Can I get 1st and last letter of emp name same time

    Quote Originally Posted by Geek_Guest View Post
    Actually I am having a emp table, I need name, Can I get 1st and last letter same time? How to get? Pls tell me the ans? When we will get mutating error?

    Question asked by visitor ramesh
    hi friends
    we never got a confirmation from ramesh that could he solve the above problem
    however in oracle if you want the first and the last letter from ename of emp
    then we can use the following syntax
    SELECT SUBSTR(ENAME,1,1)||SUBSTR(ENAME,-1,1) AS [ALIAS]
    FROM EMP;


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact