Solved

Help With SQL Select

Posted on 2007-12-05
4
212 Views
Last Modified: 2010-04-21
Experts,

I'm writing a SQL select statement for a report and have a few requirements that I must meet.

I need to select from my orders table the First and Last name of the user

Table: Orders
Column: FirstName
Column: LastName

BUT I need to select them as one column in the result set, "Name". So my select would give me something like,

::Name::
FirstName + " " + LastName

Is this possible? If so, how would I form the SQL?

Thanks so much for your help!

~ C
0
Comment
Question by:clickclickbang
4 Comments
 
LVL 10

Accepted Solution

by:
answer_me earned 200 total points
ID: 20411203
Select Isnull(FirstName,'') + '  ' + isnull(LastName,'') as '::Name::' from Orders
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 200 total points
ID: 20411220
select FirstName + ' ' + LastName as Full_Name from orders
0
 
LVL 19

Assisted Solution

by:Limbeck
Limbeck earned 100 total points
ID: 20411281
unless you use firebird, than it would be

select FirstName || ' ' || LastName as Full_Name from orders
0
 
LVL 1

Author Closing Comment

by:clickclickbang
ID: 31412835
Thanks for the quick response, didn't know it was that easy!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now