"Fan, Wellington" <[EMAIL PROTECTED]> wrote on 03/11/2005 01:09:13 PM:

> Hello MySQL'ers,
> 
> Is there a way to return a simple table of one-column, with *fixed* 
output?
> For example, I would like to return a one-column, 3-record table:
> 
> ---------
> | value |
> ---------
> |  'a'  |
> ---------
> |  'b'  |
> ---------
> |  'c'  |
> ---------
> 
> 
> Where I have specified 'a','b' and 'c' somewhere. Some *imaginary* SQL 
like:
> SELECT ['a','b','c'] as value
> 
> It seems simple, no?
> 
> 
> --
> Wellington
> 
> 
> 
> 


Try this:

(SELECT a)
UNION ALL
(SELECT b)
UNION ALL
(SELECT c);

I said "UNION ALL" instead of just "UNION" so that you would get all 3 
rows even if one of the values equals one of the others.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Reply via email to