0

So i have a quite strange need. I have to add none existing record to outcome of select query. Why? Query is a source of dropdown options in my Access application and i want to add one other option that is not in any table (as a form of default).

So now i have simple:

SELECT rowName FROM verySpecialTable

and i want to have

(SELECT rowName FROM verySpecialTable) + "default"

Can i do it by SQL? or do i have to add dummy record to verySpecialTable

Yeris
  • 59
  • 8

2 Answers2

2

You can use a UNION to the Dual table.

SELECT rowName FROM verySpecialTable
UNION
SELECT 'default' AS rowName FROM Dual

Since the Dual table might not exist in your access instance, you can emulate it as explained here: Table-less UNION query in MS Access (Jet/ACE)

Community
  • 1
  • 1
A Hocevar
  • 726
  • 3
  • 17
0

or you can use existing table itself

SELECT rowName FROM verySpecialTable
UNION
SELECT top 1 'default' AS rowName FROM verySpecialTable
Madhivanan
  • 13,470
  • 1
  • 24
  • 29