Solved

Adding a "pseudo record" to a view.

Posted on 2011-03-02
2
338 Views
Last Modified: 2012-08-13
I have a view, something like:

SELECT DISTINCT Salesman FROM SalesReport

This gives me the proper list.  However, I need to add one record that does not exist in the SalesReport table, that is "--ALL--"  (It's for an issue with Crystal Reports, if you really need to know)

Can I do this?  How?
0
Comment
Question by:Clif
[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
2 Comments
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 500 total points
ID: 35017914

SELECT DISTINCT Salesman FROM SalesReport
union all
SELECT '--ALL--'
0
 
LVL 10

Author Closing Comment

by:Clif
ID: 35017986
Ever have one of those days when the obvious escapes you?

Thanks for jarring my memory.
0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

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…
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

734 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