Unix Technical Forum

How do I append string to end of sql query results?

This is a discussion on How do I append string to end of sql query results? within the SQL Server forums, part of the Microsoft SQL Server category; --> I need to append text to the end of my sql query results. For instance, my query returns a ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 03:35 AM
diesel
 
Posts: n/a
Default How do I append string to end of sql query results?

I need to append text to the end of my sql query results.

For instance, my query returns a list of user names in
firstname.lastname. I need to add @yahoo.com to each record. So the
end result should be firstname.lastname@yahoo.com. What should by
select statement look like?

Any help?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 03:35 AM
FFunky Jensen
 
Posts: n/a
Default Re: How do I append string to end of sql query results?


"diesel" <dieselpb03@yahoo.com> skrev i en meddelelse
news:854ece22.0407131219.6f38c10a@posting.google.c om...
> I need to append text to the end of my sql query results.
>
> For instance, my query returns a list of user names in
> firstname.lastname. I need to add @yahoo.com to each record. So the
> end result should be firstname.lastname@yahoo.com. What should by
> select statement look like?
>
> Any help?


SELECT Firstname + '.' + Lastname + '@yahoo.com' AS Name
FROM tblPerson

easypeasy

--
Med venlig hilsen

Tom F Jensen
FFSoft
www.ffsoft.dk


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 03:35 AM
David Portas
 
Posts: n/a
Default Re: How do I append string to end of sql query results?

Maybe:

SELECT name + '@yahoo.com'
FROM YourTable

--
David Portas
SQL Server MVP
--


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:12 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com