OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Select multiple rows with no reference table

From: Baron Schwartz (baronxaprb.com)
Date: Tue Jan 15 2008 - 12:53:41 CST


Hi Mark,

On Jan 15, 2008 12:51 PM, Mark Wexler <mwexlerwhirlwindtechnology.com> wrote:
> Hey folks. I just joined the list. Please let me know if I am not
> posting to the correct list.

You're in the right list.

>
> I am trying to use a select statement to retreive multiple records
> without a reference table.
>
> Obviously retreiving a single record is simple enough:
>
> mysql> SELECT 'value1' AS var1, 'value2' AS var2;
>
> +--------+--------+
> | var1 | var2 |
> +--------+--------+
> | value1 | value2 |
> +--------+--------+
>
> What I need to do is something similar, but producing multiple records
> without referencing any tables:
>
> +--------+--------+
> | var1 | var2 |
> +--------+--------+
> | value1 | value2 |
> | value3 | value4 |
> | value5 | value6 |
> +--------+--------+

You can use UNION for this.

Baron

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql