Solved

Help With SQL Select

Posted on 2007-12-05
4
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 143

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

690 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