GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Database  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 130 of 138    Print  
How to get the First name,second name,Third name ?
I have a column in a table with names.Now i want to select that names like first name,second and third.

I/p like this----- names
Chandu
Kannaka prasad
Rama krishna
Kiran kumar Kora
Balaji
Chandra sekhar potta
O/p I want------ Firstname Secondname Thirdname
chandu
kanaka Prasad
Rama Krishna
Kiran Kumar Kora
Balaji
Chandra Sekhar Potta



  
Total Answers and Comments: 4 Last Update: July 01, 2008     Asked by: chandra.pc 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 06, 2008 22:02:12   #1  
rabbi08 Member Since: May 2008   Contribution: 8    

RE: How to get the First name,second name,Third name ?
select firstname||' '||secondname||' '||thirdname from tablename;

Here "||" is the concatenation operatot so names and space is concatenated.

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
June 10, 2008 14:02:12   #2  
vmdsr Member Since: June 2008   Contribution: 1    

RE: How to get the First name,second name,Third name ?

A simple select of first name, second name, third name should display in that order since some of the rows have second and third name as null.


 
Is this answer useful? Yes | No
June 11, 2008 15:46:58   #3  
amulmuthu Member Since: June 2008   Contribution: 1    

RE: How to get the First name,second name,Third name ?
SELECT firstname,secondname,thirdname from the tablename
 
Is this answer useful? Yes | No
July 01, 2008 11:30:09   #4  
seemu123 Member Since: May 2008   Contribution: 15    

RE: How to get the First name,second name,Third name ?
You can find it by

select  'Names'+'  '+firstname+'  '+secondname+'  '+thirdname from tablename ...


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape