Solved

Adding a "pseudo record" to a view.

Posted on 2011-03-02
2
299 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
2 Comments
 
LVL 32

Accepted Solution

by:
ewangoya 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Creating and Managing Databases with phpMyAdmin in cPanel.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
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.

760 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

19 Experts available now in Live!

Get 1:1 Help Now